Esempio n. 1
0
        private void btnQuickSearch_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                frmSearchProduct _frmSearchProduct = new frmSearchProduct();
                _frmSearchProduct.Owner = Window.GetWindow(this);
                _frmSearchProduct.ShowDialog();
                if (_frmSearchProduct.c_ok == 1)
                {
                    c_Product_Info_Search   = _frmSearchProduct.c_Product_Info_Search;
                    lblProduct_Name.Content = c_Product_Info_Search.Name.ToUpper();

                    lblSalePrice.Content = c_Product_Info_Search.BanLe_Price.ToString("###,###");
                    lblRemain.Content    = c_Product_Info_Search.Total_Remain.ToString("###,###");
                    txtProductCode.Text  = c_Product_Info_Search.Product_Code.ToUpper();
                    txtCount.Text        = "";

                    Get_Product_Color(c_Product_Info_Search.Product_Id);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Esempio n. 2
0
        void Get_Product_ByCode(string p_code)
        {
            try
            {
                if (txtProductCode.Text == "")
                {
                    lblProduct_Name.Content = "";
                    lblSalePrice.Content    = "";
                    lblRemain.Content       = "";
                    c_Product_Info_Search   = null;

                    return;
                }

                List <Product_Info> _lst = c_Product_Controller.Product_Get_By_Code(p_code);

                if (_lst.Count == 1)
                {
                    lblProduct_Name.Content = _lst[0].Name.ToUpper();

                    lblSalePrice.Content  = _lst[0].BanLe_Price.ToString("###,###");
                    lblRemain.Content     = _lst[0].Total_Remain.ToString("###,###");
                    txtProductCode.Text   = _lst[0].Product_Code.ToUpper();
                    txtCount.Text         = "";
                    c_Product_Info_Search = _lst[0];

                    Get_Product_Color(c_Product_Info_Search.Product_Id);
                }
                else if (_lst.Count == 0)
                {
                    lblProduct_Name.Content = "";
                    lblSalePrice.Content    = "";
                    lblRemain.Content       = "";
                    c_Product_Info_Search   = null;
                }
                else
                {
                    frmSearchProduct _frmSearchProduct = new frmSearchProduct();
                    _frmSearchProduct.Owner = Window.GetWindow(this);
                    _frmSearchProduct.c_lst_Product_Info = _lst;
                    _frmSearchProduct.ShowDialog();
                    if (_frmSearchProduct.c_ok == 1)
                    {
                        c_Product_Info_Search   = _frmSearchProduct.c_Product_Info_Search;
                        lblProduct_Name.Content = c_Product_Info_Search.Name.ToUpper();

                        lblSalePrice.Content = c_Product_Info_Search.BanLe_Price.ToString("###,###");
                        lblRemain.Content    = c_Product_Info_Search.Total_Remain.ToString("###,###");
                        txtProductCode.Text  = c_Product_Info_Search.Product_Code.ToUpper();
                        txtCount.Text        = "";

                        Get_Product_Color(c_Product_Info_Search.Product_Id);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
 private void BuildRow(DataRow dr, frmSearchProduct sp)
 {
     foreach (SearchProduct sps in sp.SearchProducts)
     {
         dr = dt.NewRow();
         dr["strItemCode"] = sps.StrProductCode;
         dr["nQuantity"]   = 0;
         dt.Rows.Add(dr);
     }
 }
        private void simpleButton4_Click(object sender, System.EventArgs e)
        {
            if (this.lkBranchTo.EditValue.ToString() == "Select Branch")
            {
                UI.ShowErrorMessage(this, "Please select Branch first", "Error");
                this.lkBranchTo.Focus();
                return;
            }
            frmSearchProduct sp = new frmSearchProduct(this.lkBranchTo.EditValue.ToString());

            if (DialogResult.OK == sp.ShowDialog(this))
            {
                DataRow dr      = null;
                int     rowloop = 0;

                if (this.gridView1.RowCount == 1)
                {
                    DataRow row = this.gridView1.GetDataRow(0);

                    if (row != null)
                    {
                        if (row[0].ToString() == "" | row[0].ToString() == "Select Product")
                        {
                            foreach (SearchProduct sps in sp.SearchProducts)
                            {
                                if (rowloop == 0)
                                {
                                    dr = dt.Rows[0];
                                    dr["strItemCode"] = sps.StrProductCode;
                                    dr["nQuantity"]   = 0;
                                }
                                else
                                {
                                    AppendRow(dr, sps);
                                }
                                rowloop++;
                            }
                        }
                        else
                        {
                            BuildRow(dr, sp);
                        }
                    }
                }
                else
                {
                    BuildRow(dr, sp);
                }
                this.gridControl1.DataSource = dt;
            }
            sp.Dispose();
        }
Esempio n. 5
0
 private void btnChose_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         frmSearchProduct _frmSearchProduct = new frmSearchProduct();
         _frmSearchProduct.Owner = Window.GetWindow(this);
         _frmSearchProduct.ShowDialog();
         if (_frmSearchProduct.c_ok == 1)
         {
             c_Product_Info_Search = _frmSearchProduct.c_Product_Info_Search;
             txtProductCode.Text   = c_Product_Info_Search.Product_Code;
             txtCount.Text         = "";
         }
     }
     catch (Exception ex)
     {
         CommonData.log.Error(ex.ToString());
     }
 }
Esempio n. 6
0
 private void HandleKeyDownEvent(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.Key == Key.L && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
         {
             LockSystem();
         }
         else if (e.Key == Key.System && e.SystemKey == Key.F4)
         {
             Application.Current.Shutdown();
         }
         else if (e.Key == Key.F2)
         {
             frmSuggest _frmSuggest = new frmSuggest();
             _frmSuggest.Owner = Window.GetWindow(this);
             _frmSuggest.ShowDialog();
         }
         else if (e.Key == Key.S && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
         {
             FrmCreateSale_Header _FrmCreateSale_Header = new FrmCreateSale_Header();
             _FrmCreateSale_Header.Owner = Window.GetWindow(this);
             _FrmCreateSale_Header.ShowDialog();
         }
         else if (e.Key == Key.D && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
         {
             FrmCreateSale_Ban_Buon_Header _FrmCreateSale_Header = new FrmCreateSale_Ban_Buon_Header();
             _FrmCreateSale_Header.Owner = Window.GetWindow(this);
             _FrmCreateSale_Header.ShowDialog();
         }
         else if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
         {
             frmSearchProduct _frmSearchProduct = new frmSearchProduct();
             _frmSearchProduct.Owner            = Window.GetWindow(this);
             _frmSearchProduct.c_is_QuickSearch = true;
             _frmSearchProduct.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         CommonData.log.Error(ex.ToString());
     }
 }