Beispiel #1
0
        private void WithoutBarcodeChkBox_CheckedChanged(object sender, EventArgs e)
        {
            if (WithoutBarcodeChkBox.Checked)
            {
                BarcodeToEditTxtBox.Clear();
                BarcodeToEditTxtBox.Enabled     = false;
                ItemDescriptionComboBox.Enabled = false;
                WithoutBarcodeComboBox.Enabled  = true;
                ByBarcDescChkBox.Enabled        = false;

                BarcodeTxtBox.Enabled = false;
                BarcodeTxtBox.Clear();
                if (IsUpdating)
                {
                    return;
                }
                UpdateItemBtn.Hide();
            }
            else
            {
                BarcodeToEditTxtBox.Enabled     = true;
                ItemDescriptionComboBox.Enabled = false;
                WithoutBarcodeComboBox.Enabled  = false;
                ByBarcDescChkBox.Enabled        = true;
                ByBarcDescChkBox.Checked        = true;
                BarcodeTxtBox.Enabled           = Enabled;
                if (IsUpdating)
                {
                    return;
                }
                BarcodeTxtBox.Clear();
                UpdateItemBtn.Hide();
            }
        }
Beispiel #2
0
 private void ByBarcDescChkBox_CheckedChanged(object sender, EventArgs e)
 {
     if (ByBarcDescChkBox.Checked)
     {
         BarcodeToEditTxtBox.Enabled     = true;
         ItemDescriptionComboBox.Enabled = false;
         if (IsUpdating)
         {
             return;
         }
         UpdateItemBtn.Hide();
     }
     else
     {
         BarcodeToEditTxtBox.Enabled     = false;
         ItemDescriptionComboBox.Enabled = true;
         if (IsUpdating)
         {
             return;
         }
         UpdateItemBtn.Hide();
         // ItemDescriptionComboBox.SelectedIndex = 0;
     }
 }
Beispiel #3
0
        private void WithoutBarcodeComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (IsUpdating)
                {
                    return;
                }
                if (WithoutBarcodeComboBox.SelectedValue != null)
                {
                    aItemData = ItemsMgmt.SelectItemByBarCode(WithoutBarcodeComboBox.SelectedValue.ToString());
                }
                else
                {
                    return;
                }
                if (aItemData.Rows.Count > 0)
                {
                    IsUpdating = true;
                    UpdateItemBtn.Show();
                    TypeComboBox.Text     = ItemTypeMgmt.SelectItemTypeByID(int.Parse(aItemData.Rows[0]["Type"].ToString()));
                    CategoryComboBox.Text = ItemCategoryMgmt.SelectItemCategoryByID(int.Parse(aItemData.Rows[0]["Category"].ToString()));
                    VendorComboBox.Text   = VendorsMgmt.SelectVendorByID(int.Parse(aItemData.Rows[0]["Vendor"].ToString()));
                    TaxLevelComboBox.Text = ItemTaxLevelMgmt.SelectItemTaxByID(int.Parse(aItemData.Rows[0]["TaxLevel"].ToString()));

                    BarcodeTxtBox.Text      = aItemData.Rows[0]["Barcode"].ToString();
                    DescriptionTxtBox.Text  = aItemData.Rows[0]["Description"].ToString();
                    QtyTxtBox.Text          = aItemData.Rows[0]["Qty"].ToString();
                    RenderPointTxtBox.Text  = aItemData.Rows[0]["RenderPoint"].ToString();
                    DateAddedTxtBox.Text    = aItemData.Rows[0]["EntryDate"].ToString();
                    SellPriceTxtBox.Text    = aItemData.Rows[0]["SellPrice"].ToString();
                    AvgCostTxtBox.Text      = aItemData.Rows[0]["AvgUnitCost"].ToString();
                    AvailableQtyTxtBox.Text = aItemData.Rows[0]["OnHandQty"].ToString(); /*@SMS V01O changed*/
                    Pricing.Controls.Clear();
                    //ADDING PRICE LEVELS
                    int ItemID = int.Parse(aItemData.Rows[0]["ID"].ToString());
                    aPriceLevelsTable = PriceLevelsMgmt.SelectAll();

                    if (aPriceLevelsTable.Rows.Count > 0)
                    {
                        foreach (DataRow r in aPriceLevelsTable.Rows)
                        {
                            if (r["Name"].ToString() != "Standard")
                            {
                                Label aLabel = new Label();
                                aLabel.Text      = r["Name"].ToString();
                                aLabel.ForeColor = Color.Black;
                                TextBox   aTextBox           = new TextBox();
                                DataTable aSpecialPriceTable = SpecialPricesMgmt.SelectSpecialPricebyItemIDandPriceLevelID(ItemID, int.Parse(r["ID"].ToString()));
                                if (aSpecialPriceTable.Rows.Count > 0)
                                {
                                    aTextBox.Text = aSpecialPriceTable.Rows[0]["Price"].ToString();
                                }
                                else
                                {
                                    aTextBox.Text = SellPriceTxtBox.Text;
                                }

                                aTextBox.Name         = r["Name"].ToString();
                                aTextBox.TextChanged += new EventHandler(Calcium_RMS.Validators.TextBoxDoubleInputChange);
                                Pricing.Controls.Add(aLabel);
                                Pricing.Controls.Add(aTextBox);
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show(MsgTxt.NotUsedTxt, MsgTxt.WarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                TaxEnclodedChkBox.Checked = false;
                UpdateMargin();
                IsUpdating = false;
            }
            catch (Exception ex)
            {
                IsUpdating = false;
                MessageBox.Show(MsgTxt.UnexpectedError + "\nException: IN[WithoutBarcodeComboBox_SelectedIndexChanged] \n" + ex.ToString(), MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }