//User Right Function=========== private void MakeEmptyForm() { ViewState["EditID"] = null; if (!FlagAdd) { BtnSave.Visible = true; } BtnUpdate.Visible = false; BtnDelete.Visible = false; TxtSuppCode.Focus(); TxtSuppCode.Text = string.Empty; TxtSuppName.Text = string.Empty; TxtSuppAddress.Text = string.Empty; TxtTelNo.Text = string.Empty; TxtMobile.Text = string.Empty; TxtEmail.Text = string.Empty; TxtNotes.Text = string.Empty; TxtSearch.Text = string.Empty; TxtFaxNo.Text = string.Empty; ddlState.SelectedValue = "0"; //----Newly Added Fields---- TxtWebsite.Text = string.Empty; TxtPerName.Text = string.Empty; TxtDesignation.Text = string.Empty; TxtContPerMobileNo.Text = string.Empty; TxtContPerEmail.Text = string.Empty; TxtContPerWebsite.Text = string.Empty; TxtSTRN.Text = string.Empty; lblSerTaxNopath.Text = string.Empty; //TxtSTJ.Text = string.Empty; //TxtVatNo.Text = string.Empty; //TxtTINNO.Text = string.Empty; //TxtCSTRN.Text = string.Empty; //TxtExciseRange.Text = string.Empty; //TxtExciseDivision.Text = string.Empty; //TxtExciseCircle.Text = string.Empty; //TxtExciseZone.Text = string.Empty; //TxtExciseCollectorate.Text = string.Empty; //TxtExciseECCNO.Text = string.Empty; //TxtTINBINNO.Text = string.Empty; TxtPanNo.Text = string.Empty; lblPanNo.Text = string.Empty; TxtTDSCertificate.Text = string.Empty; ImgTaxRegNoPath.ImageUrl = ""; ImgPanNoPath.ImageUrl = ""; AccordionPane1.HeaderContainer.Width = 660; GetSupplierCode(); FillCombo(); ReportGrid(StrCondition); BINDREPORTGRID(); }
protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e) { try { switch (e.CommandName) { case ("Select"): { if (Convert.ToInt32(e.CommandArgument) != 0) { ViewState["EditID"] = Convert.ToInt32(e.CommandArgument); Ds = Obj_SupplierMaster.GetSupplierForEdit(Convert.ToInt32(e.CommandArgument), out StrError); if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0) { TxtSuppCode.Text = Ds.Tables[0].Rows[0]["CustomerCode"].ToString(); TxtSuppName.Text = Ds.Tables[0].Rows[0]["CustomerName"].ToString(); TxtSuppAddress.Text = Ds.Tables[0].Rows[0]["Address"].ToString(); TxtTelNo.Text = Ds.Tables[0].Rows[0]["TelNo"].ToString(); TxtMobile.Text = Ds.Tables[0].Rows[0]["MobileNo"].ToString(); TxtEmail.Text = Ds.Tables[0].Rows[0]["Email"].ToString(); TxtNotes.Text = Ds.Tables[0].Rows[0]["Note"].ToString(); //-------Newly Added Fields------- TxtWebsite.Text = Ds.Tables[0].Rows[0]["WebSite"].ToString(); TxtPerName.Text = Ds.Tables[0].Rows[0]["PersonName"].ToString(); TxtDesignation.Text = Ds.Tables[0].Rows[0]["PDesignation"].ToString(); TxtContPerMobileNo.Text = Ds.Tables[0].Rows[0]["PMobileNo"].ToString(); TxtContPerEmail.Text = Ds.Tables[0].Rows[0]["PEmailId"].ToString(); TxtContPerWebsite.Text = Ds.Tables[0].Rows[0]["PWebsite"].ToString(); TxtSTRN.Text = Ds.Tables[0].Rows[0]["STaxRegNo"].ToString(); lblSerTaxNopath.Text = Ds.Tables[0].Rows[0]["ImgTaxRegNoPath"].ToString(); ImgTaxRegNoPath.ImageUrl = lblSerTaxNopath.Text; if (!string.IsNullOrEmpty(Ds.Tables[0].Rows[0]["StateID"].ToString())) { ddlState.SelectedValue = Ds.Tables[0].Rows[0]["StateID"].ToString(); } else { ddlState.SelectedValue = "0"; } //TxtSTJ.Text = Ds.Tables[0].Rows[0]["STaxJurisdiction"].ToString(); //TxtVatNo.Text = Ds.Tables[0].Rows[0]["VATNo"].ToString(); //TxtTINNO.Text = Ds.Tables[0].Rows[0]["TINNo"].ToString(); //TxtCSTRN.Text = Ds.Tables[0].Rows[0]["CentralSaleTaxRagNo"].ToString(); //TxtExciseRange.Text = Ds.Tables[0].Rows[0]["ExciseRange"].ToString(); //TxtExciseDivision.Text = Ds.Tables[0].Rows[0]["ExciseDivision"].ToString(); //TxtExciseCircle.Text = Ds.Tables[0].Rows[0]["ExciseCircle"].ToString(); //TxtExciseZone.Text = Ds.Tables[0].Rows[0]["ExciseZone"].ToString(); //TxtExciseCollectorate.Text = Ds.Tables[0].Rows[0]["ExciseCollectorate"].ToString(); //TxtExciseECCNO.Text = Ds.Tables[0].Rows[0]["ExciseECCNO"].ToString(); //TxtTINBINNO.Text = Ds.Tables[0].Rows[0]["TIN_BINNo"].ToString(); TxtPanNo.Text = Ds.Tables[0].Rows[0]["PANNo"].ToString(); lblPanNo.Text = Ds.Tables[0].Rows[0]["ImgPanNoPath"].ToString(); ImgPanNoPath.ImageUrl = lblPanNo.Text; TxtTDSCertificate.Text = Ds.Tables[0].Rows[0]["TDSCertificate"].ToString(); if (Ds.Tables[1].Rows.Count > 0) { GridTermCond.DataSource = Ds.Tables[1]; GridTermCond.DataBind(); ViewState["TermsTable"] = Ds.Tables[1]; } else { GridTermCond.DataSource = null; GridTermCond.DataBind(); SetInitialRow(); } } else { MakeEmptyForm(); } Ds = null; Obj_SupplierMaster = null; if (!FlagEdit) { BtnUpdate.Visible = true; } BtnSave.Visible = false; if (!FladDel) { BtnDelete.Visible = true; } TxtSuppCode.Focus(); } break; } } } catch (Exception ex) { throw new Exception(ex.Message); } }