Example #1
0
        public SalesCredit(SalePayData data)
        {
            InitializeComponent();
            setCombobox();
            _data = data;

            this.txtCreditCardPay.Text = data.CREDITCARDPAY.ToString(Constz.DblFormat);
            if (this.cmbCreditType.SelectedValue != null)
            {
                this.cmbCreditType.SelectedValue = data.CREDITTYPE;
                if (data.CREDITCARDID.Length > this.txtID1.MaxLength)
                {
                    this.txtID1.Text = data.CREDITCARDID.Substring(0, this.txtID1.MaxLength);
                    data.CREDITCARDID = data.CREDITCARDID.Substring(4);
                }
                else
                    this.txtID1.Text = data.CREDITCARDID;

                if (data.CREDITCARDID.Length > this.txtID2.MaxLength)
                {
                    this.txtID2.Text = data.CREDITCARDID.Substring(0, this.txtID2.MaxLength);
                    data.CREDITCARDID = data.CREDITCARDID.Substring(4);
                }
                else
                    this.txtID2.Text = data.CREDITCARDID;

                if (data.CREDITCARDID.Length > this.txtID3.MaxLength)
                {
                    this.txtID3.Text = data.CREDITCARDID.Substring(0, this.txtID3.MaxLength);
                    data.CREDITCARDID = data.CREDITCARDID.Substring(4);
                }
                else
                    this.txtID3.Text = data.CREDITCARDID;

                if (data.CREDITCARDID.Length > this.txtID4.MaxLength)
                {
                    this.txtID4.Text = data.CREDITCARDID.Substring(0, this.txtID4.MaxLength);
                }
                else
                    this.txtID4.Text = data.CREDITCARDID;

                SetCardDetail();
            }
        }
Example #2
0
        private void Pay()
        {
            if (Convert.ToDouble(this.txtCustomer.Text == "" ? "0" : this.txtCustomer.Text) == 0)
                Appz.OpenErrorDialog("¡ÃسÒÃкØÅÙ¡¤éÒ");
            else if (Convert.ToDouble(this.lblNetAmount.Text == "" ? "0" : this.lblNetAmount.Text) > 0)
            {
                SalePayData data = new SalePayData();
                data.CASH = Convert.ToDouble(this.lblNetAmount.Text);
                data.GRANDTOTAL = data.CASH;

                Transaction.SalesSummary frmSummary = new Transaction.SalesSummary(data);
                if (frmSummary.ShowDialog() == DialogResult.OK)
                {
                    this.txtCash.Text = frmSummary.Data.CASH.ToString(Constz.DblFormat);
                    this.txtCoupon.Text = frmSummary.Data.COUPON.ToString(Constz.DblFormat);
                    this.txtCreditCardID.Text = frmSummary.Data.CREDITCARDID;
                    this.txtCreditCardPay.Text = frmSummary.Data.CREDITCARDPAY.ToString(Constz.DblFormat);
                    this.txtCreditCardType.Text = frmSummary.Data.CREDITTYPE.ToString();

                    if (SaveData(false))
                    {
                        PrintData();
                        ResetState(0);
                        SetNewBarcodeFocus();
                    }
                }
            }
        }
Example #3
0
        private void Print()
        {
            if (Convert.ToDouble(this.txtCustomer.Text == "" ? "0" : this.txtCustomer.Text) == 0)
                Appz.OpenErrorDialog("¡ÃسÒÃкØÅÙ¡¤éÒ");
            else if (Convert.ToDouble(this.lblNetAmount.Text == "" ? "0" : this.lblNetAmount.Text) > 0)
            {
                SalePayData data = new SalePayData();
                data.CASH = Convert.ToDouble(this.lblNetAmount.Text);
                data.GRANDTOTAL = data.CASH;

                Transaction.SalesSummary frmSummary = new Transaction.SalesSummary(data);
                if (frmSummary.ShowDialog() == DialogResult.OK)
                {
                    this.txtCash.Text = frmSummary.Data.CASH.ToString(Constz.DblFormat);
                    this.txtCoupon.Text = frmSummary.Data.COUPON.ToString(Constz.DblFormat);
                    this.txtCreditCardID.Text = frmSummary.Data.CREDITCARDID;
                    this.txtCreditCardPay.Text = frmSummary.Data.CREDITCARDPAY.ToString(Constz.DblFormat);
                    this.txtCreditCardType.Text = frmSummary.Data.CREDITTYPE.ToString();

                    if (SaveData(true))
                    {
                        SaleInvoice frmInvoice = new SaleInvoice(Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text));
                        //ReportParameterData rdata = new ReportParameterData();
                        //rdata.PARAMETERNAME = "LOID";
                        //rdata.PARAMETERVALUE = this.txtLOID.Text;
                        //ArrayList arr = new ArrayList();
                        //arr.Add(rdata);
                        //Reports.PreviewReport pvReport = new ABBClient.Reports.PreviewReport(Constz.Report.Invoice, arr);
                        ResetState(0);
                        SetNewBarcodeFocus();
                        frmInvoice.Show();
                    }
                }
            }
        }
Example #4
0
 public SalesSummary(SalePayData data)
 {
     InitializeComponent();
     Data = data;
 }
Example #5
0
 public SalePayData GetData()
 {
     SalePayData data = new SalePayData();
     data.CREDITCARDID = this.txtID1.Text.Trim() + this.txtID2.Text.Trim() + this.txtID3.Text.Trim() + this.txtID4.Text.Trim();
     data.CREDITCARDPAY = Convert.ToDouble(this.txtCreditCardPay.Text == "" ? "0" : this.txtCreditCardPay.Text);
     if (this.cmbCreditType.SelectedValue != null) data.CREDITTYPE = Convert.ToDouble(this.cmbCreditType.SelectedValue);
     return data;
 }