void GetPayment(string ID) { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt("select case when paymentDate is not null then dbo.topersianDate(paymentDate) else null end as PaymentDate,FeetypeID,Amount,Receipt,remarks,yearID,paymentstatusID from payment where ID=" + ID); if (dt.Rows.Count > 0) { txtApplicationDate.Value = dt.Rows[0][0].ToString(); ddlApprovalStatus.SelectedValue = dt.Rows[0][1].ToString(); txtAmount.Value = dt.Rows[0][2].ToString(); txtReceipt.Value = dt.Rows[0][3].ToString(); txtSignBoard.Value = dt.Rows[0][4].ToString(); if (dt.Rows[0][1].ToString() == "2") { dvSpec.Visible = true; } if (!string.IsNullOrEmpty(dt.Rows[0][5].ToString())) { ddlYear.SelectedValue = dt.Rows[0][5].ToString(); } ddlPaymentStatus.SelectedValue = dt.Rows[0][6].ToString(); dt.Dispose(); } } }
void GetGroup(string ID) { DataTable dt = obj.Selectdt("select * from paymentCategory where ID=" + ID); if (dt.Rows.Count > 0) { if (!string.IsNullOrEmpty(ddlGroup.SelectedValue)) { ddlGroup.SelectedValue = dt.Rows[0]["BusinessGroupID"].ToString(); ddlClass.DataBind(); } if (!string.IsNullOrEmpty(ddlClass.SelectedValue)) { ddlClass.SelectedValue = dt.Rows[0]["BusinessClassID"].ToString(); } if (!string.IsNullOrEmpty(ddlLocationCategory.SelectedValue)) { ddlLocationCategory.SelectedValue = dt.Rows[0]["LocationCategoryID"].ToString(); } if (!string.IsNullOrEmpty(ddlCategory.SelectedValue)) { ddlCategory.SelectedValue = dt.Rows[0]["BusinessCategoryID"].ToString(); } txtPrice.Value = dt.Rows[0]["Payment"].ToString(); } dt.Dispose(); }
void GetBusinessInfo() { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select b.ID,dbo.ToPersianDate(bl.IssueDate) as IssueDate,dbo.ToPersianDate(bl.ExpirationDate) as ExpiryDate,b.OwnerName,b.FatherName,c.Name_Local as Class,ct.Name_Local as Category, b.street+' - ' +b.ShopNumber as ShopAddress, d.Code as DistrictID,b.photo,b.Code from BusinessLicense bl inner join Business b on b.ID=bl.BusinessID inner join zDistrict d on d.ID=b.DistrictID inner join zBusinessClass c on c.ID=b.BusinessClassID inner join zBusinessCategory ct on ct.ID=b.BusinessCategoryID where bl.StatusID=1 and bl.ID=" + Session["LicenseID"].ToString()); if (dt.Rows.Count > 0) { ID = dt.Rows[0][0].ToString(); IssueDate = dt.Rows[0][1].ToString(); ExpiryDate = dt.Rows[0][2].ToString(); Name = dt.Rows[0][3].ToString(); FatherName = dt.Rows[0][4].ToString(); Class = dt.Rows[0][5].ToString(); Category = dt.Rows[0][6].ToString(); ShopAddress = dt.Rows[0][7].ToString(); DistrictID = dt.Rows[0][8].ToString(); //if (dt.Rows[0][9] != null) //{ // Photo = ByteToImage((Byte[])dt.Rows[0][9]); //} Code = dt.Rows[0][10].ToString(); } dt.Dispose(); } } catch (Exception) { } }
void BindChartAvgAge() { ConClass obj = new ConClass(); DataTable dt = obj.Selectdt(@"select ft.Name_local as Indicator, isnull(sum(p.amount),0)/1000 as [عواید] from zFeeType ft left outer join Payment p on ft.ID=p.FeeTypeID where ft.ID in (1,2) group by ft.Name_Local"); foreach (DataRow dr in dt.Rows) { Series series = new Series(); for (int i = 1; i < dt.Columns.Count; i++) { int y = Convert.ToInt32(dr[i]); series.Points.AddXY(dt.Columns[i].ColumnName.ToString(), y); series.Points[i - 1].Label = dr[i].ToString(); series.Points[i - 1].Font = new System.Drawing.Font("Trebuchet MS", 7.0F, System.Drawing.FontStyle.Regular); } chAvgAge.Series.Add(series); } chAvgAge.Series[0].LegendText = " (۰۰۰)فیس خدمات شهری"; chAvgAge.Series[0].Color = Color.DeepPink; chAvgAge.Series[1].LegendText = "(۰۰۰)فیس لوحه"; chAvgAge.Series[1].Color = Color.Green; chAvgAge.Visible = true; chAvgAge.Legends[0].Enabled = true; chAvgAge.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false; chAvgAge.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false; chAvgAge.ChartAreas["ChartArea1"].AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 7.25F, System.Drawing.FontStyle.Regular); chAvgAge.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 7.25F, System.Drawing.FontStyle.Regular); }
void LoadForm() { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt("select dbo.topersianDate(AssessmentDate) as AssessmentDate,ApprovalStatusID,ApprovalRemarks,ApprovedBy,Capital,AnnualSales,EmployeeMale,EmployeeFemale,latitude,longitude from business where ID=" + Session["BusinessID"].ToString()); if (dt.Rows.Count > 0) { txtApplicationDate.Value = dt.Rows[0][0].ToString(); ddlApprovalStatus.SelectedValue = dt.Rows[0][1].ToString(); txtRemarks.Value = dt.Rows[0][2].ToString(); txtApprovedBy.Value = dt.Rows[0][3].ToString(); txtCapital.Value = dt.Rows[0][4].ToString(); txtAnnualSales.Value = dt.Rows[0][5].ToString(); txtMale.Value = dt.Rows[0][6].ToString(); txtFemale.Value = dt.Rows[0][7].ToString(); txtLat.Value = dt.Rows[0][8].ToString(); txtLong.Value = dt.Rows[0][9].ToString(); } } } catch (Exception) { } }
void LoadForm(string code) { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select BusinessName,OwnerName,FatherName,Gender,Tazkira,dbo.topersianDate(ApplicationDate) as ApplicationDate, ProvinceID,DistrictID,Street,Address,Phone,Photo,Code,latitude,longitude,Verificationremarks from Cart where ID=" + code); if (dt.Rows.Count > 0) { txtCode.Value = dt.Rows[0]["Code"].ToString(); txtID.Value = code; Session["CartID"] = code; txtEName.Value = dt.Rows[0]["BusinessName"].ToString(); txtOwnerName.Value = dt.Rows[0]["OwnerName"].ToString(); txtFatherName.Value = dt.Rows[0]["FatherName"].ToString(); ddlGender.SelectedValue = dt.Rows[0]["Gender"].ToString(); txtNID.Value = dt.Rows[0]["Tazkira"].ToString(); txtApplicationDate.Value = dt.Rows[0]["ApplicationDate"].ToString(); ddlProvince.SelectedValue = dt.Rows[0]["ProvinceID"].ToString(); BindDistrict(); ddlDistrict.SelectedValue = dt.Rows[0]["DistrictID"].ToString(); txtStreet.Value = dt.Rows[0]["Street"].ToString(); txtAddress.Value = dt.Rows[0]["Address"].ToString(); txtPhone.Value = dt.Rows[0]["Phone"].ToString(); txtLatitude.Value = dt.Rows[0]["Latitude"].ToString(); txtLongnitude.Value = dt.Rows[0]["Longitude"].ToString(); txtRep.Value = dt.Rows[0]["Verificationremarks"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["Photo"].ToString()))// != null) { byte[] bytes = (byte[])dt.Rows[0]["Photo"]; string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); Image1.ImageUrl = "data:image/jpg;base64," + base64String; Image1.Visible = true; } //if (HttpContext.Current.User.IsInRole("Entry")) //{ // btnSave.Enabled = false; // // System.Windows.Forms.MessageBox.Show("Test"); //} } dt.Dispose(); } } catch (Exception ex) { //System.Windows.Forms.MessageBox.Show(ex.Message); } }
void GetGroup(string ID) { DataTable dt = obj.Selectdt("select ID,Name,Name_Local from zbusinessGroup where ID=" + ID); if (dt.Rows.Count > 0) { txtName_Local.Value = dt.Rows[0]["Name_local"].ToString(); txtName.Value = dt.Rows[0]["Name"].ToString(); } dt.Dispose(); }
protected void btnSearch_Click(object sender, EventArgs e) { using (ConClass obj = new ConClass()) { //System.Windows.Forms.MessageBox.Show(GetFilter()); rptMarkers.DataSource = obj.Selectdt(@"Select top 5000 ID, Latitude, longitude, Address as Description, BusinessName as title, Street as Name from cart where latitude is not null and " + GetFilter()); rptMarkers.DataBind(); } }
void GetGroup(string ID) { DataTable dt = obj.Selectdt("select ID,[Year],Target,DistrictID from DistrictTarget where ID=" + ID); if (dt.Rows.Count > 0) { txtYear.Value = dt.Rows[0]["Year"].ToString(); txtTarget.Value = dt.Rows[0]["Target"].ToString(); ddlDistrictNew.SelectedValue = dt.Rows[0]["DistrictID"].ToString(); } dt.Dispose(); }
protected void btnSearch_Click(object sender, EventArgs e) { using (ConClass obj = new ConClass()) { //System.Windows.Forms.MessageBox.Show(GetFilter()); rptMarkers.DataSource = obj.Selectdt(@";with Bpayment as (select BusinessID, 1 as PaymentStatus from payment where YearID=" + GetYear() + @") Select top 5000 ID, Latitude, longitude, Address as Description, BusinessName as title, Street as Name, isnull(p.PaymentStatus, 0) as PaymentStatus from business left join Bpayment p on p.BusinessID = business.ID where latitude is not null and " + GetFilter()); rptMarkers.DataBind(); } }
void BindCombo(string sql, DropDownList ddl) { try { System.Data.DataTable dt = obj.Selectdt(sql); ddl.DataSource = dt; ddl.DataTextField = "Name"; ddl.DataValueField = "ID"; ddl.DataBind(); } catch (Exception) { throw; } }
void GetPayment(string ID) { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt("select dbo.topersianDate(IssueDate) as IssueDate,dbo.topersianDate(ExpirationDate) as ExpiryDate,StatusID from BusinessLicense where ID=" + ID); if (dt.Rows.Count > 0) { txtIssueDate.Value = dt.Rows[0][0].ToString(); //txtExpiryDate.Value = dt.Rows[0][1].ToString(); //ddlStatus.SelectedValue = dt.Rows[0][2].ToString(); dt.Dispose(); } } }
void GetBusinessInfo() { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select b.ID, dbo.ToPersianDate(bl.IssueDate) as IssueDate, dbo.ToPersianDate(bl.ExpirationDate) as ExpiryDate, b.BusinessName, b.OwnerName, b.FatherName, b.Tazkira, b.Address, d.Code as DistrictID, b.photo, b.Code,b.VerificationRemarks from CartLicense bl inner join cart b on b.ID=bl.BusinessID inner join zDistrict d on d.ID=b.DistrictID where bl.StatusID=1 and bl.ID=" + Session["CartLicenseID"].ToString()); if (dt.Rows.Count > 0) { ID = dt.Rows[0][0].ToString(); IssueDate = dt.Rows[0][1].ToString(); ExpiryDate = dt.Rows[0][2].ToString(); BusinessName = dt.Rows[0][3].ToString(); Name = dt.Rows[0][4].ToString(); FatherName = dt.Rows[0][5].ToString(); Tazkira = dt.Rows[0][6].ToString(); ShopAddress = dt.Rows[0][7].ToString(); DistrictID = dt.Rows[0][8].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0][9].ToString())) { Photo = ByteToImage((Byte[])dt.Rows[0][9]); } else { Photo = (System.Drawing.Image)Bitmap.FromFile(Server.MapPath("~/images/no_photo.jpg")); // set image } Code = dt.Rows[0][10].ToString(); VerificationRemarks = dt.Rows[0][11].ToString(); } dt.Dispose(); } } catch (Exception) { } }
void GetPayment(string ID) { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt("select case when paymentDate is not null then dbo.topersianDate(paymentDate) end as PaymentDate,FeetypeID,Amount,Receipt,PaymentStatusID,yearID from payment where ID=" + ID); if (dt.Rows.Count > 0) { txtApplicationDate.Value = dt.Rows[0][0].ToString(); ddlApprovalStatus.SelectedValue = dt.Rows[0][1].ToString(); txtAmount.Value = dt.Rows[0][2].ToString(); txtReceipt.Value = dt.Rows[0][3].ToString(); ddlPaymentStatus.SelectedValue = dt.Rows[0][4].ToString(); ddlYear.SelectedValue = dt.Rows[0][5].ToString(); dt.Dispose(); } } }
void GetAmount() { try { using (ConClass obj = new ConClass()) { if (gvGroup.Rows.Count > 0) { txtAmount.Value = obj.Selectdt("Select dbo.funLicenseFeeByID(" + Session["BusinessID"].ToString() + ")").Rows[0][0].ToString(); } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
void LoadForm() { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select b.*,p.Name_Local as Province,d.Name_local as District, dbo.ToPersianDate(b.ApplicationDate) as ApplicationDate1, gn.Name_local as Gender1 from Cart b left outer join zGender gn on gn.ID=b.Gender left outer join zProvince p on p.ID=b.ProvinceID left outer join zDistrict d on d.id=b.DistrictID where b.ID=" + Session["CartID"].ToString()); if (dt.Rows.Count > 0) { lblCode.Text = dt.Rows[0]["Code"].ToString(); lblBusinessName.Text = dt.Rows[0]["BusinessName"].ToString(); lblOwnername.Text = dt.Rows[0]["Ownername"].ToString(); lblFatherName.Text = dt.Rows[0]["FatherName"].ToString(); lblGender.Text = dt.Rows[0]["Gender1"].ToString(); lblTazkira.Text = dt.Rows[0]["Tazkira"].ToString(); lblApplicationDate.Text = dt.Rows[0]["ApplicationDate1"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["Photo"].ToString())) { byte[] bytes = (byte[])dt.Rows[0]["Photo"]; string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); Image1.ImageUrl = "data:image/jpg;base64," + base64String; } lblProvince.Text = dt.Rows[0]["Province"].ToString(); lblDistrict.Text = dt.Rows[0]["District"].ToString(); lblStreet.Text = dt.Rows[0]["Street"].ToString(); lblPhone.Text = dt.Rows[0]["Phone"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblX.Text = dt.Rows[0]["Latitude"].ToString(); lblY.Text = dt.Rows[0]["Longitude"].ToString(); } dt.Dispose(); } } catch (Exception ex) { } }
void BindChartBusiness() { ConClass obj = new ConClass(); DataTable dt; if (Cache["data"] == null) { dt = obj.Selectdt(@"select N'اصناف' as Businesses, count(distinct case when datepart(q,applicationDate)=1 then ID else null end) Q1, count(distinct case when datepart(q,applicationDate)=2 then ID else null end) Q2, count(distinct case when datepart(q,applicationDate)=3 then ID else null end) Q3, count(distinct case when datepart(q,applicationDate)=4 then ID else null end) Q4 from business where left(dbo.ToPersianDate(applicationDate),4)=left(dbo.ToPersianDate(getdate()),4)"); Cache.Insert("data", dt, null, DateTime.MaxValue, TimeSpan.Zero); } else { dt = (DataTable)Cache["data"]; } foreach (DataRow dr in dt.Rows) { Series series = new Series(); for (int i = 1; i < dt.Columns.Count; i++) { int y = Convert.ToInt32(dr[i]); series.Points.AddXY(dt.Columns[i].ColumnName.ToString(), y); series.Points[i - 1].Label = dr[i].ToString(); series.Points[i - 1].Font = new System.Drawing.Font("Trebuchet MS", 7.0F, System.Drawing.FontStyle.Regular); } chBusiness.Series.Add(series); } chBusiness.Series[0].LegendText = " تعداد اصناف "; chBusiness.Series[0].Color = Color.DeepPink; chBusiness.Visible = true; chBusiness.Legends[0].Enabled = true; chBusiness.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false; chBusiness.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false; chBusiness.ChartAreas["ChartArea1"].AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 7.25F, System.Drawing.FontStyle.Regular); chBusiness.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 7.25F, System.Drawing.FontStyle.Regular); }
protected void btnSearch_Click(object sender, EventArgs e) { string filter = "1<1"; if (!string.IsNullOrEmpty(txtCode.Value)) { filter = " b.code=N'" + txtCode.Value + "'"; } if (!HttpContext.Current.User.IsInRole("Admin")) { filter = filter + " and b.DistrictID=" + HttpContext.Current.Profile["DistrictID"].ToString(); } if (!string.IsNullOrEmpty(txtBusinessName.Value)) { filter = " b.BusinessName=N'" + txtBusinessName.Value + "'"; } if (!string.IsNullOrEmpty(txtName.Value) && !string.IsNullOrEmpty(txtFName.Value)) { filter = " b.OwnerName=N'" + txtName.Value + "' and b.FatherName=N'" + txtFName.Value + "'"; } if (!string.IsNullOrEmpty(filter)) { dsPaymentCategory.SelectCommand = @"select b.ID, b.Code,b.BusinessName,b.OwnerName,b.fathername,d.name_local as District,c.Name_local as Class,b.phone,ct.Name_Local as Category,c.ID as ClassID,ct.ID as CatID from business b left outer join zBusinessClass c on c.ID=b.BusinessClassID left outer join zDistrict d on d.ID=b.DistrictID left outer join zBusinessCategory ct on ct.ID=b.BusinessCategoryID where " + filter; //dsPaymentCategory.SelectParameters[0].DefaultValue= txtCode.Value; dsPaymentCategory.DataBind(); gvGroup.DataBind(); if (gvGroup.Rows.Count > 0) { using (ConClass obj = new ConClass()) { Session["BusinessIDForPayment"] = obj.Selectdt("Select b.ID from business b where " + filter).Rows[0][0].ToString(); } } else { Session["BusinessIDForPayment"] = ""; } gvPayment.DataBind(); } }
protected void BindGrid(string BusinessID) { string filter = "1<1"; if (!string.IsNullOrEmpty(txtCode.Value)) { filter = " b.code=N'" + txtCode.Value + "'"; } if (!string.IsNullOrEmpty(txtName.Value)) { filter = " b.BusinessName=N'" + txtName.Value + "'"; } if (!string.IsNullOrEmpty(BusinessID)) { filter = " b.ID=" + BusinessID; } if (!string.IsNullOrEmpty(filter)) { // dsPaymentCategory.SelectCommand = @"select b.ID, b.Code,b.BusinessName,b.OwnerName,b.fathername,d.name_local as District,c.Name_local as Class,b.phone,ct.Name_Local as Category from business b left outer join zBusinessClass c on c.ID=b.BusinessClassID //left outer join zDistrict d on d.ID=b.DistrictID left outer join zBusinessCategory ct on ct.ID=b.BusinessCategoryID where b.ID in (select BusinessID from payment where yearID=left(dbo.topersianDate(getdate()),4)) and " + filter; dsPaymentCategory.SelectCommand = @"select b.ID, b.Code,b.BusinessName,b.OwnerName,b.fathername,d.name_local as District,c.Name_local as Class,b.phone,ct.Name_Local as Category from business b left outer join zBusinessClass c on c.ID=b.BusinessClassID left outer join zDistrict d on d.ID=b.DistrictID left outer join zBusinessCategory ct on ct.ID=b.BusinessCategoryID where " + filter; //dsPaymentCategory.SelectParameters[0].DefaultValue= txtCode.Value; dsPaymentCategory.DataBind(); gvGroup.DataBind(); if (gvGroup.Rows.Count > 0) { using (ConClass obj = new ConClass()) { Session["BusinessIDForLicense"] = obj.Selectdt("Select b.ID from business b where " + filter).Rows[0][0].ToString(); } } else { Session["BusinessIDForLicense"] = ""; } gvPayment.DataBind(); } }
void GetGroup(string ID) { DataTable dt = obj.Selectdt("select * from zDistrict where ID=" + ID); if (dt.Rows.Count > 0) { txtCode.Value = dt.Rows[0]["Code"].ToString(); txtName_Local.Value = dt.Rows[0]["Name_local"].ToString(); txtName.Value = dt.Rows[0]["Name"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["ProvinceID"].ToString())) { ddlProvince.SelectedValue = dt.Rows[0]["ProvinceID"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[0]["LocationCategoryID"].ToString())) { ddlLocationCategory.SelectedValue = dt.Rows[0]["LocationCategoryID"].ToString(); } } dt.Dispose(); }
void BindChartLoan() { ConClass obj = new ConClass(); DataTable dt = obj.Selectdt(@"select g.Name_Local as BusinessGroup,count(b.ID) as Businesses from business b inner join zBusinessGroup g on g.ID=b.GroupID group by g.Name_Local"); string[] x = new string[dt.Rows.Count]; int[] y = new int[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { x[i] = dt.Rows[i][0].ToString(); y[i] = Convert.ToInt32(dt.Rows[i][1]); } chLoanSector.Series[0].Points.DataBindXY(x, y); chLoanSector.Series[0].ChartType = SeriesChartType.Pie; chLoanSector.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false; chLoanSector.Legends[0].Enabled = true; chLoanSector.Visible = true; //obj.Dispose(); }
void LoadForm() { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select b.*,g.name_local as BusinessGroup,c.Name_local as Class,ct.Name_local as Category,p.Name_Local as Province,d.Name_local as District, dbo.ToPersianDate(isnull(b.assessmentDate,'')) as AssessmentDate1,dbo.ToPersianDate(b.ApplicationDate) as ApplicationDate1, a.Name_local as ApprovalStatus,gn.Name_local as Gender1 from business b left outer join zBusinessGroup g on g.ID=b.GroupID left outer join zBusinessClass c on c.ID=b.BusinessClassID left outer join zBusinessCategory ct on ct.ID=b.BusinessCategoryID left outer join zGender gn on gn.ID=b.Gender left outer join zProvince p on p.ID=b.ProvinceID left outer join zDistrict d on d.id=b.DistrictID left outer join zApprovalStatus a on a.id=b.ApprovalStatusID where b.ID=" + Session["BusinessID"].ToString()); if (dt.Rows.Count > 0) { lblCode.Text = dt.Rows[0]["Code"].ToString(); lblBusinessName.Text = dt.Rows[0]["BusinessName"].ToString(); lblOwnername.Text = dt.Rows[0]["Ownername"].ToString(); lblFatherName.Text = dt.Rows[0]["FatherName"].ToString(); lblGender.Text = dt.Rows[0]["Gender1"].ToString(); lblTazkira.Text = dt.Rows[0]["Tazkira"].ToString(); lblApplicationDate.Text = dt.Rows[0]["ApplicationDate1"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["Photo"].ToString())) { byte[] bytes = (byte[])dt.Rows[0]["Photo"]; string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); Image1.ImageUrl = "data:image/jpg;base64," + base64String; } lblGroup.Text = dt.Rows[0]["BusinessGroup"].ToString(); lblClass.Text = dt.Rows[0]["Class"].ToString(); lblCategory.Text = dt.Rows[0]["Category"].ToString(); lblProvince.Text = dt.Rows[0]["Province"].ToString(); lblDistrict.Text = dt.Rows[0]["District"].ToString(); lblStreet.Text = dt.Rows[0]["Street"].ToString(); lblPhone.Text = dt.Rows[0]["Phone"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblEmail.Text = dt.Rows[0]["Email"].ToString(); lblShopNumber.Text = dt.Rows[0]["ShopNumber"].ToString(); lblWebsite.Text = dt.Rows[0]["Website"].ToString(); lblAssessmentDate.Text = dt.Rows[0]["AssessmentDate1"].ToString(); lblApprovalStatus.Text = dt.Rows[0]["ApprovalStatus"].ToString(); lblRemarks.Text = dt.Rows[0]["ApprovalRemarks"].ToString(); lblApprovedBy.Text = dt.Rows[0]["ApprovedBy"].ToString(); lblCapital.Text = dt.Rows[0]["Capital"].ToString(); lblAnnualSales.Text = dt.Rows[0]["AnnualSales"].ToString(); lblMale.Text = dt.Rows[0]["EmployeeMale"].ToString(); lblFemale.Text = dt.Rows[0]["EmployeeFemale"].ToString(); lblX.Text = dt.Rows[0]["Latitude"].ToString(); lblY.Text = dt.Rows[0]["Longitude"].ToString(); } dt.Dispose(); } } catch (Exception) { } }
void LoadForm(string code) { try { using (ConClass obj = new ConClass()) { DataTable dt = obj.Selectdt(@"select BusinessName,OwnerName,FatherName,Gender,Tazkira, dbo.topersianDate(ApplicationDate) as ApplicationDate,GroupID,BusinessClassID,BusinessCategoryID, ProvinceID,DistrictID,Street,Address,Phone,Email,ShopNumber,Website,Photo,Code,LessThan6 from business where ID=" + code); if (dt.Rows.Count > 0) { txtCode.Value = dt.Rows[0]["Code"].ToString(); txtID.Value = code; Session["BusinessID"] = code; txtEName.Value = dt.Rows[0]["BusinessName"].ToString(); txtOwnerName.Value = dt.Rows[0]["OwnerName"].ToString(); txtFatherName.Value = dt.Rows[0]["FatherName"].ToString(); ddlGender.SelectedValue = dt.Rows[0]["Gender"].ToString(); txtNID.Value = dt.Rows[0]["Tazkira"].ToString(); txtApplicationDate.Value = dt.Rows[0]["ApplicationDate"].ToString(); ddlGroup.SelectedValue = dt.Rows[0]["GroupID"].ToString(); BindGroupDDL(dt.Rows[0]["GroupID"].ToString()); ddlClass.SelectedValue = dt.Rows[0]["BusinessClassID"].ToString(); ddlCategory.SelectedValue = dt.Rows[0]["BusinessCategoryID"].ToString(); ddlProvince.SelectedValue = dt.Rows[0]["ProvinceID"].ToString(); BindDistrict(); ddlDistrict.SelectedValue = dt.Rows[0]["DistrictID"].ToString(); txtStreet.Value = dt.Rows[0]["Street"].ToString(); txtAddress.Value = dt.Rows[0]["Address"].ToString(); txtPhone.Value = dt.Rows[0]["Phone"].ToString(); txtEmail.Value = dt.Rows[0]["Email"].ToString(); txtShopNumber.Value = dt.Rows[0]["ShopNumber"].ToString(); txtWebsite.Value = dt.Rows[0]["Website"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["LessThan6"].ToString())) { if (dt.Rows[0]["LessThan6"].ToString() == "True") { chkLessThan6.Checked = true; } else { chkLessThan6.Checked = false; } } if (!string.IsNullOrEmpty(dt.Rows[0]["Photo"].ToString()))// != null) { byte[] bytes = (byte[])dt.Rows[0]["Photo"]; string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); Image1.ImageUrl = "data:image/jpg;base64," + base64String; Image1.Visible = true; } //if (HttpContext.Current.User.IsInRole("Entry")) //{ // btnSave.Enabled = false; // // System.Windows.Forms.MessageBox.Show("Test"); //} btnPrint.Enabled = true; } dt.Dispose(); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }