public string AddagentSlab(string type,string slabID,string agentID,string MC,string TDC ) { int Result = 0; if (type!="0" && slabID !="0") { productdata = new ProductData(); product = new Product(); product.BindSlabID = 0; product.MonthelyCollection = string.IsNullOrEmpty(MC) ? string.Empty : Convert.ToString(MC); product.TillDateColletion = string.IsNullOrEmpty(TDC) ? string.Empty : Convert.ToString(TDC); product.TypeID = string.IsNullOrEmpty(type) ? 0 : Convert.ToInt32(type); product.SlabID = string.IsNullOrEmpty(slabID) ? 0 : Convert.ToInt32(slabID); product.AgencyID = string.IsNullOrEmpty(agentID) ? 0 : Convert.ToInt32(agentID); product.CreatedBy = GlobalInfo.Userid; product.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); product.ModifiedBy = GlobalInfo.Userid; product.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); product.flag = "Insert"; Result = productdata.AddBindSlab(product); } if (Result > 0) { return Result.ToString(); } else { return Result.ToString(); } }
protected void btnClick_btnUpdatSlab(object sender, EventArgs e) { productdata = new ProductData(); product = new Product(); product.BindSlabID = Convert.ToInt32(hfBindSlab.Value); product.MonthelyCollection = "0"; product.TillDateColletion = "0"; //product.MonthelyCollection = string.IsNullOrEmpty(txtMonthelyCollection.Text.ToString()) ? string.Empty : Convert.ToString(txtMonthelyCollection.Text); //product.TillDateColletion = string.IsNullOrEmpty(txtMonthelyCollection.Text.ToString()) ? string.Empty : Convert.ToString(txtMonthelyCollection.Text); product.TypeID = string.IsNullOrEmpty(dpType.SelectedValue.ToString()) ? 0 : Convert.ToInt32(dpType.SelectedValue); product.SlabID = string.IsNullOrEmpty(dpSlab.SelectedValue.ToString()) ? 0 : Convert.ToInt32(dpSlab.SelectedValue); product.AgencyID = string.IsNullOrEmpty(dpAgent.SelectedValue.ToString()) ? 0 : Convert.ToInt32(dpAgent.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"); product.flag = "Update"; int Result = 0; Result = productdata.AddBindSlab(product); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "BindSlab Info Updated Successfully"; ClearTextBox(); BindSlabInfo(); pnlError.Update(); upMain.Update(); uprouteList.Update(); btnupdateSlab.Visible = false; btnBindSlab.Visible = true; } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }