Esempio n. 1
0
        private void simpleButtonOK_Click(object sender, System.EventArgs e)
        {
            if (lkpEdtPromotionCode.EditValue == null || lkpEdtPromotionCode.Text == "")
            {
                return;
            }

            int nPromotionTypeID = (int)lkpEdtPromotionCode.GetColumnValue("nPromotionTypeID");

            if (lkpEdtPromotionCode.EditValue != null)
            {
                // free Product
                if (nPromotionTypeID == 1)
                {
                    ACMS.XtraUtils.GridViewUtils.UpdateData(gridView2);
                    if (gridControl2.DataSource != null)
                    {
                        DataRow[] rowList = ((DataTable)gridControl2.DataSource).Select("Checked = true");

                        if (rowList.Length > 0)
                        {
                            myPOS.NewBillReceiptFreebies(rowList, lkpEdtPromotionCode.EditValue.ToString(), false);
                        }
                    }
                }
                else
                {
                    ACMS.XtraUtils.GridViewUtils.UpdateData(gridView1);

                    if (gridControl1.DataSource != null)
                    {
                        DataRow[] rowList = ((DataTable)gridControl1.DataSource).Select("Checked = true");

                        if (rowList.Length > 0)
                        {
                            myPOS.NewBillReceiptFreebies(rowList, lkpEdtPromotionCode.EditValue.ToString(), true);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void simpleButtonOK_Click(object sender, System.EventArgs e)
        {
            if (lkpEdtPromotionCode.EditValue == null || lkpEdtPromotionCode.Text == "")
            {
                return;
            }

            int nPromotionTypeID = (int)lkpEdtPromotionCode.GetColumnValue("nPromotionTypeID");

            if (lkpEdtPromotionCode.EditValue != null && ValidatePackageQty())
            {
                // free Product
                //if (nPromotionTypeID == 1)
                //{
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView2);
                if (gridControl2.DataSource != null)
                {
                    DataRow[] rowList = ((DataTable)gridControl2.DataSource).Select("Checked = true");


                    if (rowList.Length > 0)
                    {
                        ValidateFreebieQty();



                        if (!myIsFinishLoadStockRecon)
                        {
                            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
                            connection       = new SqlConnection(connectionString);

                            // StartProgressBar

                            BackgroundWorker bw = new BackgroundWorker();
                            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
                            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

                            m_fmProgress = new fmProgress();
                            bw.RunWorkerAsync();
                            m_fmProgress.ShowDialog(this);
                            m_fmProgress = null;

                            //StartProgressBar
                            myIsFinishLoadStockRecon = true;
                        }
                        myPOS.NewBillReceiptFreebies(rowList, lkpEdtPromotionCode.EditValue.ToString(), false);
                    }
                }
                //}
                //else
                //{
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView1);

                if (gridControl1.DataSource != null)
                {
                    DataRow[] rowList1 = ((DataTable)gridControl1.DataSource).Select("Checked = true");

                    if (rowList1.Length > 0)
                    {
                        myPOS.NewBillReceiptFreebies(rowList1, lkpEdtPromotionCode.EditValue.ToString(), true);
                    }
                }
                //}
            }
        }