Пример #1
0
 void btn_Click(object sender, EventArgs e)
 {
     Button btn = (Button)sender;
     CardModel CardTemp = (CardModel)btn.Tag;
     Card = CardTemp;
     this.DialogResult = System.Windows.Forms.DialogResult.Yes;
 }
Пример #2
0
 public frmChooseCard(CardModel _Card)
 {
     InitializeComponent();
     Card = _Card;
 }
Пример #3
0
        private int CheckPaymentSplitBill(CardModel item)
        {
            int index = -1;
            try
            {
                if (lstPaymentSplitBill.Count > 0)
                {
                    for (int i = 0; i < lstPaymentSplitBill.Count; i++)
                    {
                        if (lstPaymentSplitBill[i].PaymentTypeID == item.PayMenyID)
                        {
                            index = i;
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmPayMent:::::::::CheckPayment:::::::::::::::::::::::::" + ex.Message);
            }
            return index;
        }
Пример #4
0
 private void btnCard_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtTender.Text != string.Empty && Convert.ToDouble(txtTender.Text)>0)
         {
             lockTextChange = true;
             frmChooseCard frm = new frmChooseCard(cardTemp);
             if (frm.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
             {
                 cardTemp = frm.Card;
                 cardTemp.PayMenyID = 2;
                 cardTemp.SubTotal = Convert.ToDouble(txtTender.Text);
                 addCard(cardTemp);
                 addPayment(cardTemp);
                 InvoiceByCardModel item = new InvoiceByCardModel();
                 item.CardID = cardTemp.CardID;
                 item.Total = cardTemp.SubTotal * 1000;
                 item.NameCard = cardTemp.CardName;
                 lstInvoiceByCard.Add(item);
                 lstInvoiceByCardSplitBill.Add(item);
                 CheckTotal();
                 lockTextChange = false;
             }
         }
     }
     catch (Exception ex)
     {
         LogPOS.WriteLog("frmPayMent:::::::::::::::::::::::::::::::::;btnCard_Click::::::::::::::::::::::::::;;" + ex.Message);
     }
 }
Пример #5
0
        private void addPayment(CardModel item)
        {
            try
            {
                int result = CheckPayment(item);
                int resultSplitBill = CheckPaymentSplitBill(item);
                if (result != -1)
                {
                    lstPayment[result].Total = lstPayment[result].Total + item.SubTotal;
                    lstPaymentSplitBill[result].Total = lstPaymentSplitBill[result].Total;
                }
                else
                {
                    PayMentModel pay = new PayMentModel();
                    pay.PaymentTypeID = item.PayMenyID;
                    pay.Total = item.SubTotal;
                    lstPayment.Add(pay);

                }

                //////////////
                if (resultSplitBill != -1)
                {
                    lstPaymentSplitBill[result].Total = lstPaymentSplitBill[result].Total + item.SubTotal;

                }
                else
                {
                    PayMentModel pay = new PayMentModel();
                    pay.PaymentTypeID = item.PayMenyID;
                    pay.Total = item.SubTotal;

                    lstPaymentSplitBill.Add(pay);
                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmPayMent:::::::::::::::::addPayment:::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Пример #6
0
 private void addCard(CardModel item)
 {
     try
     {
         UCPaymentCard ucCard = new UCPaymentCard();
         item.PayMenyID = 2;
         ucCard.lblStt.Text ="#"+ CountUcPayMent().ToString();
         ucCard.lblMethodType.Text = item.CardName;
         ucCard.lblTotal.Text = "$" + money.Format2(item.SubTotal * 1000);
         ucCard.Tag = item;
         ucCard.Click += ucCard_Click;
         flpPaymentType.Controls.Add(ucCard);
     }
     catch (Exception ex)
     {
         LogPOS.WriteLog("frmPayment::::::::::::::::::::::::::::addCard::::::::::::::::::::" + ex.Message);
     }
 }