本文整理汇总了C#中System.Collections.ArrayList.AddParam方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.AddParam方法的具体用法?C# ArrayList.AddParam怎么用?C# ArrayList.AddParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ArrayList
的用法示例。
在下文中一共展示了ArrayList.AddParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcesingKey
//.........这里部分代码省略.........
break;
}
}
else if (selectedBottle != 0)
{
error(1000, "Position " + (int)key + " is not occupied", lcd.Screen);
}
break;
}
break;
// vyber objemu lahve ----------------------------------------------------------------------
case (int)Menu.SCREEN.selectVolumeBottle:
Bottle svb = new Bottle(selectedBottle);
switch (key)
{
case Menu.KEY.ESC:
selectedBottle = 0;
lcd.Screen = (int)Menu.SCREEN.selectBottle1; // navrat na vyber lahve
ProcesingKey(Menu.KEY.noKey);
break;
case Menu.KEY.select_1:
selectedVolumeBottle = svb.Volume;
lcd.Screen = (int)Menu.SCREEN.set3Number;
ProcesingKey(Menu.KEY.noKey);
break;
case Menu.KEY.select_2: // zkopiruji volume
selectedVolumeBottle = svb.Volume;
int bottleResidue = svb.Residue;
svb.SetVolume(svb.Volume); // vybrany objem
svb.SaveBottle(selectedBottle); // a ulozim do stavu
ArrayList log = new ArrayList();
log.AddParam(LOG.TIME, DateTime.Now.ToString("HH:mm:ss"));
log.AddParam(LOG.CARD, Card.cardid);
log.AddParam(LOG.EVENT, EVENT.BOTTLECHANGE);
log.AddParam(LOG.BOTTLE, selectedBottle);
log.AddParam(LOG.BTLVOLUME, selectedVolumeBottle);
log.AddParam(LOG.RESIDUE, bottleResidue);
Logger.WriteLogg(log);
selectedBottle = 0;
selectedVolumeBottle = 0;
SucessSave(2000, (int)Menu.SCREEN.selectBottle1);
break;
default:
lcd.Print(20, 5, 2, 11, "Selected position is " + selectedBottle.ToString());
lcd.Print(20, 30, 2, 11, svb.Name);
lcd.Print(310, 75, 2, 5, svb.Volume.ToString() + "ml");
lcd.Print(20, 110, 2, 1, "Residue");
lcd.Print(20, 140, 2, 1, svb.Residue.ToString() + " ml");
lcd.Print(20, 230, 3, 1, "Select option above");
break;
}
break;
// vyber davky ------------------------------------------------------------------------------------
case (int)Menu.SCREEN.selectDose:
Bottle sd = new Bottle(selectedBottle);
switch (key)
{
case Menu.KEY.ESC:
lcd.Screen = (int)Menu.SCREEN.selectBottle1; // navrat na vyber lahve
ProcesingKey(Menu.KEY.noKey);
示例2: Dispensing
//-----------------------------------------------------------------------------------------------------------
static void Dispensing(int bottle, Choice choice)
{
if (!blockTouch)
{
Bottle lahev = new Bottle(bottle);
int dose = 0; // objem v cl
int price = 0;
int onTime = 0;
int pieces = 0; // pocet kusu
Int64 Credit = 0;
switch (choice)
{
case Choice.small:
pieces = lahev.SmallPieces;
dose = lahev.SmallDose;
price = lahev.SmallPrice;
// je sleva ?
if (Card.discount > 0) { price -= (price / 100) * Card.discount; }
onTime = lahev.SmallTime;
break;
case Choice.medium:
pieces = lahev.MiddlePieces;
dose = lahev.MiddleDose;
price = lahev.MiddlePrice;
// je sleva ?
if (Card.discount > 0) { price -= (price / 100) * Card.discount; }
onTime = lahev.MiddleTime;
break;
case Choice.large:
pieces = lahev.LargePieces;
dose = lahev.LargeDose;
price = lahev.LargePrice;
// je sleva ?
if (Card.discount > 0) { price -= (price / 100) * Card.discount; }
onTime = lahev.LargeTime;
break;
}
if ((lahev.Residue - dose) >= Settings.minResidue)
{
if (onTime > 0 && dose > 0)
{
if (Card.credit >= price)
{
Credit = Card.credit - (Int32)price; // odectu kredit
lahev.AddTotalDose(dose); // prictu do lokalni statistiky hodnotu
//lahev.AddTotalPrice(price); // prictu do lokalni statistiky cenu
lahev.SetResiude(lahev.Residue - dose); // odectu z lahve dose
lahev.IncPieces((int)choice); // prictu kusy
pieces++;
Bill.PurchaseAdd(price); // prictu nakup
string txtDoseVal = dose.ToString() + "ml";
string billLine = (StringPad(2, Bill.RowBill.ToString()) + ". " + StringPad(2, bottle.ToString()) + " " + StringPad(5, txtDoseVal) + " " + StringPad(10, price, true));
Bill.BillLineAdd(billLine);
ButtonRS485.VentilsOnTime(FromButton.bottle, onTime);
BUTTON = false;
PARSEBUTTON = false;
sl031.SetCreditNew(Credit);
lahev.SaveBottle(bottle);
Thread.Sleep((onTime * 10) + 500); // a cekam :-)
lcd.PrintBill(290, billLine);
LcdUpdateClient("credit");
ArrayList log = new ArrayList();
log.AddParam(LOG.TIME, DateTime.Now.ToString("HH:mm:ss"));
log.AddParam(LOG.CARD, Card.cardid);
log.AddParam(LOG.EVENT, EVENT.DISPENSING);
log.AddParam(LOG.BOTTLE, bottle);
log.AddParam(LOG.RESIDUE, lahev.Residue);
log.AddParam(LOG.DOSE, (int)choice);
log.AddParam(LOG.PRICE, price);
Logger.WriteLogg(log);
dispensed = true;
}
else // uz neni ani panak
{
dispensed = false;
lcd.Beep(10);
lcd.FillRectangle(0x0000, 0xFFFF, 5, 5, 475, 267);
lcd.Print(20, 80, 2, 1, ("We are sorry, but you have low credit"), 0x81);
lcd.Print(100, 140, 2, 1, ("Your balance: " + StringPad(2, (int)Credit, true) + " " + Settings.currency), 0x81);
lcd.Print(100, 170, 2, 4, ("Price for: " + StringPad(2, price, true) + " " + Settings.currency), 0x81);
BlockTouch(5000, (int)Menu.SCREEN.cardUser);
}
}
else if (dose == 0)
{
dispensed = false;
lcd.Beep(10);
lcd.FillRectangle(0x0000, 0xFFFF, 5, 5, 475, 267);
//.........这里部分代码省略.........