protected void txtQty_TextChanged(object sender, EventArgs e) { try { if (CategoriesDropDownList.SelectedIndex > 0) { if (ItemsDropDownList.SelectedIndex > 0) { AddSaleItems(); txtQty.Text = ""; txtSubTotal.Text = total.ToString(); CategoriesDropDownList.Focus(); DiscountCalculation(); } else { ItemsDropDownList.Focus(); lblItems.ForeColor = Color.Red; } } else { CategoriesDropDownList.Focus(); lblCategories.ForeColor = Color.Red; } } catch { } }
protected void AddButton_Click(object sender, EventArgs e) { Items _Items = new Items(); _Items.Code = txtCode.Text; _Items.Name = txtName.Text; _Items.ReorderLevel = 5; _Items.Size = SizeDropDownList.SelectedItem.ToString(); _Items.CategoriesId = Convert.ToInt32(CategoriesDropDownList.SelectedValue); if (CategoriesDropDownList.SelectedIndex > 0) { if (SizeDropDownList.SelectedIndex > 0) { decimal AlreadyExistCaegory = _ItemRepository.AlreadyExistName(_Items); if (AlreadyExistCaegory >= 1) { ShowMessage("This Item Already Here!!!...", MessageType.Warning); } else { int Savesuccess = _ItemRepository.Add(_Items); if (Savesuccess > 0) { ShowMessage("Successfully Saved Item....", MessageType.Success); LoadItem(); AutoCodeGenerate(); GetAllCategories(); txtName.Text = ""; CategoriesDropDownList.ClearSelection(); SizeDropDownList.ClearSelection(); //Response.Redirect(Request.Url.AbsoluteUri); } else { ShowMessage("Failed Saving Item", MessageType.Warning); } } } else { ShowMessage("Select Size", MessageType.Warning); SizeDropDownList.Focus(); } } else { ShowMessage("At First Select Catgeory", MessageType.Warning); CategoriesDropDownList.Focus(); } }
protected void AddButton_Click(object sender, EventArgs e) { try { if (CategoriesDropDownList.SelectedIndex > 0 && ShelfsDropDownList.SelectedIndex > 0) { if (RemainShelf >= 0) { Items _Items = new Items(); _Items.Code = txtCode.Text; _Items.Name = txtName.Text; _Items.GenericName = txtGenericName.Text; _Items.ReorderLevel = Convert.ToInt32(txtReorderLevel.Text); _Items.CategoriesId = Convert.ToInt32(CategoriesDropDownList.SelectedValue); _Items.ShelfsId = Convert.ToInt32(ShelfsDropDownList.SelectedValue); int saveSuccess = _ItemRepository.Add(_Items); if (saveSuccess > 0) { lblmsg.Text = "This Item Save Successefully!!...."; lblmsg.ForeColor = Color.Green; AutoCodeGenerate(); Response.Redirect(Request.Url.AbsoluteUri); } else { lblmsg.Text = "This Item Saving Failed!!...."; lblmsg.ForeColor = Color.Red; } } else { lblmsg.Text = "This Shelf Fully Done!!....Please Try Another Shelf"; lblmsg.ForeColor = Color.Red; } } else { CategoriesDropDownList.Focus(); } } catch (Exception ex) { lblmsg.Text = ex.Message; } }