private void BtnView_Click(object sender, EventArgs e) { try { if (DataGridView.SelectedRows.Count == 1) { dspub = pubclass.GetCompanyInfo(); string OrganName = dspub.Tbl_Organiztion[0].OrganiztionName.Trim(); OCA.WinUI.BaseForms.BaseReportForm reportform = new OCA.WinUI.BaseForms.BaseReportForm(); OCA.WinUI.Dabirkhaneh.Report.ExportMailReport reportfile = new OCA.WinUI.Dabirkhaneh.Report.ExportMailReport(); reportfile.SetParameterValue("OrganiztionName", OrganName); reportfile.SetParameterValue("Mail_Date", DataGridView.SelectedRows[0].Cells["Mail_Date"].Value.ToString().Trim()); reportfile.SetParameterValue("Mail_Text", DataGridView.SelectedRows[0].Cells["Mail_Text"].Value.ToString().Trim()); reportfile.SetParameterValue("Mail_Refer", DataGridView.SelectedRows[0].Cells["Refer_Description"].Value.ToString().Trim()); reportfile.SetParameterValue("Mail_Name", DataGridView.SelectedRows[0].Cells["Mail_Name"].Value.ToString().Trim()); reportform.crystalReportViewer1.ReportSource = reportfile; reportform.Show(); } else { mesg.Warning("خطا", "لطفا نامه مورد نظر را انتخاب کنید!"); } } catch (Exception ex) { mesg.Error("خطا", ex.Message); } }
private void Load_Chart() { try { TreeNode baseNode = new TreeNode(""); dspub.Clear(); dspub = puclass.GetCompanyInfo(); baseNode.Text = dspub.Tbl_Organiztion[0].OrganiztionName; CmbUpUnit.Items.Clear(); CmbUpUnit.Items.Add(dspub.Tbl_Organiztion[0].OrganiztionName); txtUnitName.Clear(); dsunit.Clear(); dsunit = unitclass.GetUnits(); for (int i = 1; i <= dsunit.Tbl_Unit.Rows.Count; i++) { InsertTree(baseNode, dsunit.Tbl_Unit[i - 1].UnitName.Trim(), dsunit.Tbl_Unit[i - 1].UpperUnit.Trim()); CmbUpUnit.Items.Add(dsunit.Tbl_Unit[i - 1].UnitName.Trim()); } treeView1.Nodes.Clear(); treeView1.Nodes.Add(baseNode); treeView1.ExpandAll(); CmbUpUnit.SelectedIndex = 0; } catch (Exception ex) { mesg.Error("خطا", ex.Message); } }
public OCA.Common.DataSets.Public GetCompanyInfo() { try { dspub.Clear(); dspub = pubclass.GetCompanyInfo(); return(dspub); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void CompanyInfo_Load(object sender, EventArgs e) { dspub.Clear(); dspub = pubclass.GetCompanyInfo(); txtOrganiztionName.Text = dspub.Tbl_Organiztion[0].OrganiztionName; try { txtTel1.Text = dspub.Tbl_Organiztion[0].Tel1; } catch { } try { txtTel2.Text = dspub.Tbl_Organiztion[0].Tel2; } catch { } try { txtTel3.Text = dspub.Tbl_Organiztion[0].Tel3; } catch { } try { txtFax1.Text = dspub.Tbl_Organiztion[0].Fax1; } catch { } try { txtFax2.Text = dspub.Tbl_Organiztion[0].Fax2; } catch { } try { txtAddress1.Text = dspub.Tbl_Organiztion[0].Address1; } catch { } try { txtAddress2.Text = dspub.Tbl_Organiztion[0].Address2; } catch { } try { MemoryStream mstrm = new MemoryStream(dspub.Tbl_Organiztion[0].LogoImage); PicLogoImage.Image = Image.FromStream(mstrm); } catch { } }