
AUCTION_TYPE={Standart:0,Holland:1};AUCTION_STATE={Created:0,Started:1,Closed:2,Sold:3};AUCTION_STATE.getText=function(i){switch(i){case 0:return"Created";case 1:return"Started";case 2:return"Closed";case 3:return"Sold";}}
Auction=WL.Class(Object,function()
{Auction.base.constructor.call(this);this.id=0;this.productID=0;this.type=AUCTION_TYPE.Standart;this.state=AUCTION_STATE.Created;this.startPrice=0;this.currentPrice=0;this.winnerID=0;this.dateStart=new Date();this.dateStop=new Date();this.minPrice=0;this.momentPrice=0;this.quantity=0;this.putCount=0;this.upRuleID=0;this.upPeriod=new WL.Objects.Time();this.downRuleID=0;this.downPeriod=new WL.Objects.Time();},function(type)
{type.read=function(reader)
{this.id=reader.readInt("id");this.productID=reader.readInt("productID");this.type=reader.readInt("type");this.state=reader.readInt("state");this.startPrice=reader.readFloat("startPrice");this.currentPrice=reader.readFloat("currentPrice");this.winnerID=reader.readInt("winnerID");this.dateStart=reader.readDate("dateStart");this.dateStop=reader.readDate("dateStop");this.minPrice=reader.readFloat("minPrice");this.momentPrice=reader.readFloat("momentPrice");this.quantity=reader.readInt("quantity");this.putCount=reader.readInt("putCount");this.upRuleID=reader.readInt("upRuleID");this.upPeriod=reader.readTime("upPeriod");this.downRuleID=reader.readInt("downRuleID");this.downPeriod=reader.readTime("downPeriod");}
type.write=function(writer)
{writer.writeElementString("id",this.id);writer.writeElementString("productID",this.productID);writer.writeElementString("type",this.type);writer.writeElementString("state",this.state);writer.writeElementString("startPrice",this.startPrice);writer.writeElementString("currentPrice",this.currentPrice);writer.writeElementString("winnerID",this.winnerID);writer.writeDate("dateStart",this.dateStart);writer.writeDate("dateStop",this.dateStop);writer.writeElementString("minPrice",this.minPrice);writer.writeElementString("momentPrice",this.momentPrice);writer.writeElementString("quantity",this.quantity);writer.writeElementString("putCount",this.putCount);writer.writeElementString("upRuleID",this.upRuleID);writer.writeTime("upPeriod",this.upPeriod);writer.writeElementString("downRuleID",this.downRuleID);writer.writeTime("downPeriod",this.downPeriod);}});AuctionInfo=WL.Class(Object,function()
{AuctionInfo.base.constructor.call(this);this.id=0;this.state=AUCTION_STATE.Created;this.currentPrice=0;this.retailPrice=0;this.winnerID=0;this.winner="";this.dateStop=new Date();this.nextBidValue=0;this.bidsCount=0;this.autoBidValue=0;},function(type)
{type.read=function(reader)
{this.id=reader.readInt("id");this.state=reader.readInt("state");this.currentPrice=reader.readFloat("currentPrice");this.retailPrice=reader.readFloat("retailPrice");this.dateStop=reader.readDate("dateStop");this.winnerID=reader.readInt("winnerID");this.winner=reader.readString("winner");this.nextBidValue=reader.readInt("nextBidValue");this.bidsCount=reader.readInt("bidsCount");this.autoBidValue=reader.readFloat("autoBidValue");}});ProductSettings=WL.Class(Object,function()
{ProductSettings.base.constructor.call(this);this.productID=0;this.customAuctionSettings=false;this.autoCreateAuction=false;this.auctionType=AUCTION_TYPE.Standart;this.auctionDuration=new WL.Objects.Time();this.auctionStartPrice=0;this.auctionUpRuleID=0;this.auctionUpPeriod=0;},function(type)
{type.read=function(reader)
{this.productID=reader.readInt("productID");this.autoCreateAuction=reader.readBoolean("autoCreateAuction");this.customAuctionSettings=reader.readBoolean("customAuctionSettings");this.auctionType=reader.readInt("auctionType");this.auctionDuration=reader.readTime("auctionDuration");this.auctionStartPrice=reader.readFloat("auctionStartPrice");this.auctionUpRuleID=reader.readInt("auctionUpRuleID");this.auctionUpPeriod=reader.readTime("auctionUpPeriod");}
type.write=function(writer)
{writer.writeElementString("productID",this.productID);writer.writeBoolean("autoCreateAuction",this.autoCreateAuction);writer.writeBoolean("customAuctionSettings",this.customAuctionSettings);writer.writeElementString("auctionType",this.auctionType);writer.writeTime("auctionDuration",this.auctionDuration);writer.writeElementString("auctionStartPrice",this.auctionStartPrice);writer.writeElementString("auctionUpRuleID",this.auctionUpRuleID);writer.writeTime("auctionUpPeriod",this.auctionUpPeriod);}});