Beispiel #1
0
 private void frmReportSetting_Load(object sender, EventArgs e)
 {
     try
     {
         if (ObjBReport == null)
         {
             ObjBReport = new BReportDesign();
         }
         if (ObjEReport == null)
         {
             ObjEReport = new EReportDesign();
         }
         ObjBReport.GetReportSettings(ObjEReport);
         if (ObjEReport.dtReportSettings.Rows.Count > 0)
         {
             BindData();
         }
         FillLVSection();
         txtReportName.Text     = "ANGEBOT";
         dtpReportDate.DateTime = DateTime.Now;
         cmbLVSection.EditValue = null;
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Beispiel #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (ObjBReport == null)
         {
             ObjBReport = new BReportDesign();
         }
         if (ObjEReport == null)
         {
             ObjEReport = new EReportDesign();
         }
         ParseReportSettings();
         ObjBReport.SaveReportSetting(ObjEReport);
         if (_ProjectID > 0)
         {
             DataTable dtPos = new DataTable();
             dtPos.Columns.Add("FromPos");
             dtPos.Columns.Add("ToPos");
             if (radioGroupSelection.SelectedIndex == 0)
             {
                 this.Hide();
                 if (chkMAMO.Checked)
                 {
                     GenerateReportWithputMAMO("Complete", dtPos, cmbLVSection.Text);
                 }
                 else if (chkOnheMontagePrice.Checked)
                 {
                     GenerateReportWithMinutes("Complete", dtPos, cmbLVSection.Text);
                 }
                 else
                 {
                     GenerateReport("Complete", dtPos, cmbLVSection.Text);
                 }
                 this.Close();
             }
             else if (radioGroupSelection.SelectedIndex == 1)
             {
                 if (gvAddRemovePositions.RowCount == 0)
                 {
                     if (Utility._IsGermany == true)
                     {
                         XtraMessageBox.Show("Bitte machen Sie VON / BIS Angaben.");
                     }
                     else
                     {
                         XtraMessageBox.Show("Please Add From and To values.");
                     }
                     return;
                 }
                 string tfrom = null;
                 string tTo   = null;
                 foreach (DataGridViewRow dr in gvAddRemovePositions.Rows)
                 {
                     DataRow drPos = dtPos.NewRow();
                     tfrom = Convert.ToString(dr.Cells[0].Value);
                     tTo   = Convert.ToString(dr.Cells[1].Value);
                     string _fromParent = string.Empty;
                     string _ToParent   = string.Empty;
                     if (tfrom.Contains("."))
                     {
                         _fromParent = tfrom.Substring(0, tfrom.IndexOf('.'));
                     }
                     if (tTo.Contains("."))
                     {
                         _ToParent = tTo.Substring(0, tTo.IndexOf('.'));
                     }
                     if (_fromParent != _ToParent)
                     {
                         if (Utility._IsGermany)
                         {
                             throw new Exception("Bitte geben Sie den gleichen Parent-Level ein..!");
                         }
                         else
                         {
                             throw new Exception("Please enter the same Parent level..!");
                         }
                     }
                     drPos["fromPos"] = Utility.PrepareOZ(tfrom, stRaster);
                     drPos["toPos"]   = Utility.PrepareOZ(tTo, stRaster);
                     dtPos.Rows.Add(drPos);
                 }
                 this.Hide();
                 if (chkMAMO.Checked)
                 {
                     GenerateReportWithputMAMO("Title", dtPos, cmbLVSection.Text);
                 }
                 else if (chkOnheMontagePrice.Checked)
                 {
                     GenerateReportWithMinutes("Title", dtPos, cmbLVSection.Text);
                 }
                 else
                 {
                     GenerateReport("Title", dtPos, cmbLVSection.Text);
                 }
                 this.Close();
             }
             else if (radioGroupSelection.SelectedIndex == 2)
             {
                 if (string.IsNullOrEmpty(cmbLVSection.Text))
                 {
                     throw new Exception("Please select atleast one LV Section");
                 }
                 this.Hide();
                 if (chkMAMO.Checked)
                 {
                     GenerateReportWithputMAMO("LVSection", dtPos, cmbLVSection.Text);
                 }
                 else if (chkOnheMontagePrice.Checked)
                 {
                     GenerateReportWithMinutes("LVSection", dtPos, cmbLVSection.Text);
                 }
                 else
                 {
                     GenerateReport("LVSection", dtPos, cmbLVSection.Text);
                 }
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         Utility.ShowError(ex);
     }
 }