Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            rack         = new Rack();
            purchaseData = new PurchaseData();

            rack.RackName = string.IsNullOrEmpty(txtRackName.Text.ToString()) ? string.Empty : Convert.ToString(txtRackName.Text);
            //category.Description = string.IsNullOrEmpty(txtDesciption.Text.ToString()) ? string.Empty : Convert.ToString(txtDesciption.Text);
            if (dpIsActive.SelectedItem.Value == "1")
            {
                rack.IsActive = true;
            }
            else
            {
                rack.IsActive = false;
            }
            rack.SecCount = Convert.ToInt32(txtSectionCount.Text);
            rack.Flag     = 1; //1 for INSERT
            //string secs = Convert.ToDouble(txtSectionCount.Text).ToString("000");



            int Result = 0;

            Result = purchaseData.RacksDML(rack);



            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Rack Sections Add  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();
            }
        }
Exemplo n.º 2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            rack          = new Rack();
            purchaseData  = new PurchaseData();
            rack.RackId   = Convert.ToInt32(hfBrandId.Value);
            rack.RackName = string.IsNullOrEmpty(txtRackName.Text.ToString()) ? string.Empty : Convert.ToString(txtRackName.Text);

            if (dpIsActive.SelectedItem.Value == "1")
            {
                rack.IsActive = true;
            }
            else
            {
                rack.IsActive = false;
            }

            rack.Flag = 3; //3 for Update



            int Result = 0;

            Result = purchaseData.RacksDML(rack);



            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Rack Edited  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();
            }
        }