Beispiel #1
0
        protected void btnClick_btnUpdateTypeID(object sender, EventArgs e)
        {
            productdata          = new ProductData();
            product              = new Product();
            product.CommodityID  = string.IsNullOrEmpty(hfCommodityID.Value) ? 0 : Convert.ToInt32(hfCommodityID.Value);
            product.Commodity    = string.IsNullOrEmpty(txtCommodity.Text.ToString()) ? string.Empty : Convert.ToString(txtCommodity.Text);
            product.TypeID       = string.IsNullOrEmpty(dpType.SelectedValue.ToString()) ? 0 : Convert.ToInt32(dpType.SelectedValue);
            product.CreatedBy    = GlobalInfo.Userid;
            product.Createddate  = DateTime.Now.ToString("dd-MM-yyyy");
            product.ModifiedBy   = GlobalInfo.Userid;
            product.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy");
            if (dpStatus.SelectedItem.Value == "1")
            {
                product.Status = false;
            }
            if (dpStatus.SelectedItem.Value == "2")
            {
                product.Status = true;
            }
            product.flag = "Update";
            int Result = 0;

            Result = productdata.AddCommodityInfo(product);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Commodity Updated  Successfully";

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