Ejemplo n.º 1
0
 public void Refresh()
 {
     txtCode.Text = "";
     txtQty.Text  = "";
     txtCost.Text = "";
     txtMrp.Text  = "";
     CategoriesDropDownList.ClearSelection();
     SizeDropDownList.ClearSelection();
     ItemsDropDownList.ClearSelection();
 }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
 public void Refresh()
 {
     GetALLCategories();
     AutoCodeGenerate();
     CategoriesDropDownList.ClearSelection();
     ItemsDropDownList.ClearSelection();
     txtCustomerName.Text = "";
     txtCustomerName.Focus();
     txtSubTotal.Text   = "";
     txtDiscount.Text   = "";
     txtDiscount.Text   = "0";
     txtTotalCost.Text  = "";
     txtPaidAmount.Text = "";
     lblChanges.Text    = "";
 }
Ejemplo n.º 4
0
        protected void AddItemButton_Click(object sender, EventArgs e)
        {
            try
            {
                ItemsM _ItemsM = new ItemsM();
                _ItemsM.Name         = txtItemName.Text;
                _ItemsM.Price        = Convert.ToDecimal(txtPrice.Text);
                _ItemsM.CategoriesId = Convert.ToInt32(CategoriesDropDownList.SelectedValue);

                decimal AlreadyExistItem = _ItemRepository.AlreadyExistItem(_ItemsM);
                if (AlreadyExistItem >= 1)
                {
                    ShowMessage("This Item Already Here!!..This Category", MessageType.Warning);
                }
                else
                {
                    int savesuccess = _ItemRepository.Add(_ItemsM);
                    if (savesuccess > 0)
                    {
                        ShowMessage("Successfully Saved Item", MessageType.Success);
                        LoadItem();
                        txtItemName.Text = "";
                        txtPrice.Text    = "";
                        CategoriesDropDownList.ClearSelection();
                    }
                    else
                    {
                        ShowMessage("Failed Saving Item", MessageType.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message, MessageType.Warning);
            }
        }