Exemplo n.º 1
0
        private void submitItemRackSection(int flag, int Itmid = 0)
        {
            item                 = new Item();
            purchaseData         = new PurchaseData();
            item.Flag            = 6; //deleting existing ItemsRackSections
            item.ItemName        = string.Empty;
            item.ItemDescription = string.Empty;
            item.ItemId          = Itmid;
            purchaseData.ItemDML(item);

            foreach (ListItem li in lbSection.Items)
            {
                if (li.Selected)
                {
                    try
                    {
                        item.RackId          = Convert.ToInt32(dpRack.SelectedItem.Value);
                        item.SectionId       = Convert.ToInt32(li.Value);
                        item.Flag            = flag; //for Adding(4) or updating ItemsRackSections
                        item.ItemName        = string.Empty;
                        item.ItemDescription = string.Empty;
                        item.ItemId          = Itmid;
                        int Result = 0;
                        Result = purchaseData.ItemDML(item);
                    }
                    catch (ArgumentException ex)
                    { }
                }
            }
        }
Exemplo n.º 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            item         = new Item();
            purchaseData = new PurchaseData();

            item.CategoryId      = Convert.ToInt32(dpCategory.SelectedItem.Value);
            item.ItemName        = string.IsNullOrEmpty(txtItemName.Text.ToString()) ? string.Empty : Convert.ToString(txtItemName.Text);
            item.ItemDescription = string.IsNullOrEmpty(txtDesciption.Text.ToString()) ? string.Empty : Convert.ToString(txtDesciption.Text);
            if (dpIsActive.SelectedItem.Value == "1")
            {
                item.IsActive = true;
            }
            else
            {
                item.IsActive = false;
            }

            item.Flag = 1; //1 for INSERT

            int Result = 0;

            Result = purchaseData.ItemDML(item);



            if (Result > 0)
            {
                submitItemRackSection(4);
                // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('.modal-backdrop').removeClass(.modal-backdrop);", true);
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Item Added Successfully";

                ClearTextBox();
                GetList();
                pnlError.Update();

                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }