private void ShowCompanyDetails(int recordId) { SqlParameter[] arrParam = new SqlParameter[2]; arrParam[0] = new SqlParameter("@Action", "SELECT_ByID"); arrParam[1] = new SqlParameter("@ID", recordId); DataSet DSRecords = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_BusinessLocation_CRUD", arrParam); DataTable DTRecords = DSRecords.Tables[0]; if (DTRecords.Rows.Count > 0) { MVBusinessLocation.ActiveViewIndex = 1; ImgLogo.ImageUrl = DTRecords.Rows[0]["Image"].ToString(); BindCompanyDetails(); DDLCompanyName.ClearSelection(); DDLCompanyName.Items.FindByValue(DTRecords.Rows[0]["CompanyID"].ToString()).Selected = true; BindCompanyTINNumber(DDLCompanyName.SelectedValue); TBBusinessLocationName.Text = DTRecords.Rows[0]["BusinessLocationName"].ToString(); TBDocumentPrefix.Text = DTRecords.Rows[0]["DocumentPrefix"].ToString(); TBDocumentStartNumber.Text = DTRecords.Rows[0]["DocumentStartNumber"].ToString(); ShowAddressDetails(Convert.ToInt32(DTRecords.Rows[0]["RegisteredAddress"].ToString())); TBTINNumber.Text = DTRecords.Rows[0]["TINNo"].ToString(); TBESICNumber.Text = DTRecords.Rows[0]["ESICNumber"].ToString(); TBLBTNo.Text = DTRecords.Rows[0]["LBTNumber"].ToString(); TBCSTNo.Text = DTRecords.Rows[0]["CSTNumber"].ToString(); TBPTRegistrationNumber.Text = DTRecords.Rows[0]["PTRegistrationNumber"].ToString(); TBServiceTaxNumber.Text = DTRecords.Rows[0]["ServiceTaxNumber"].ToString(); ShowUserDetail(Convert.ToInt32(DTRecords.Rows[0]["ID"])); ShowGodownDetail(Convert.ToInt32(DTRecords.Rows[0]["ID"])); btnSubmit.Text = "Update"; } }
private void ClearForm() { DDLCompanyName.ClearSelection(); TBBusinessLocationName.Text = string.Empty; TBDocumentPrefix.Text = string.Empty; TBDocumentStartNumber.Text = string.Empty; TBCompanyTINNumber.Text = string.Empty; TBTINNumber.Text = string.Empty; TBESICNumber.Text = string.Empty; TBLBTNo.Text = string.Empty; TBCSTNo.Text = string.Empty; TBPTRegistrationNumber.Text = string.Empty; TBServiceTaxNumber.Text = string.Empty; TBAddressLine1.Text = string.Empty; TBAddressLine2.Text = string.Empty; TBCity.Text = string.Empty; TBState.Text = string.Empty; TBCountry.Text = string.Empty; TBPin.Text = string.Empty; TBPhoneNumber.Text = string.Empty; TBMobileNumber.Text = string.Empty; TBFaxNumber.Text = string.Empty; TBEmail.Text = string.Empty; TBWebsite.Text = string.Empty; TBUserName.Text = string.Empty; TBPassWord.Text = string.Empty; TBRPassWord.Text = string.Empty; TBGodownName.Text = string.Empty; TBGodownShortForm.Text = string.Empty; ImgLogo.ImageUrl = ""; }
private void BindCompanyDetails() { SqlParameter[] arrparm = new SqlParameter[2]; arrparm[0] = new SqlParameter("@Action", "SELECT_ByStatus"); arrparm[1] = new SqlParameter("@Status", true); DataSet DSRecord = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.StoredProcedure, "SP_Company_CRUD", arrparm); if (DSRecord.Tables[0].Rows.Count > 0) { DDLCompanyName.DataSource = DSRecord.Tables[0]; DDLCompanyName.DataTextField = "CompanyName"; DDLCompanyName.DataValueField = "ID"; DDLCompanyName.DataBind(); DDLCompanyName.Items.Insert(0, new ListItem("Select Company", "0")); } }