private void نوبتدومToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgv1.RowCount > 0 && dgv1.SelectedRows.Count == 1)
         {
             string Student_id  = dgv1.CurrentRow.Cells["codeMelliDataGridViewTextBoxColumn"].Value.ToString();
             int    Years_id_FK = (from a in db.tbl_Years orderby a.id descending select a).FirstOrDefault().id;
             var    N2          = (from a in db.tbl_Karnameh where a.Student_id_FK == Student_id && a.Nobat == 2 && a.Years_id_FK == Years_id_FK select a).FirstOrDefault();
             var    N1          = (from a in db.tbl_Karnameh where a.Student_id_FK == Student_id && a.Nobat == 1 && a.Years_id_FK == Years_id_FK select a).FirstOrDefault();
             if (N2 != null)
             {
                 int?TosifAmalkard = (from a in db.tbl_Classes where a.id == Classid select a).FirstOrDefault().tbl_Payeh.TosifAmalkard_id_FK;
                 Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
                 if (TosifAmalkard != null)
                 {
                     Sti.Load(Application.StartupPath + "\\Reports\\rptNobat2TosifKarnameh.mrt");
                     Sti.Compile();
                     Sti["str_Student_id"]    = Student_id;
                     Sti["lng_Karnameh_id_1"] = N1.id;
                     Sti["lng_Karnameh_id_2"] = N2.id;
                     Sti.ShowWithRibbonGUI();
                 }
                 else
                 {
                     Sti.Load(Application.StartupPath + "\\Reports\\rptNobat2MarkKarnameh.mrt");
                     Sti.Compile();
                     Sti["str_Student_id"]    = Student_id;
                     Sti["lng_Karnameh_id_1"] = N1.id;
                     Sti["lng_Karnameh_id_2"] = N2.id;
                     Sti.ShowWithRibbonGUI();
                 }
             }
             else
             {
                 MessageBox.Show("کارنامه نوبت دوم ثبت نهایی نشده است", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show("لطفا یک سطر را انتخاب نمایید", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptMoavenEjraei.mrt");
         Sti.Compile();
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
Beispiel #3
0
 private void buttonX4_Click(object sender, EventArgs e)
 {
     try
     {
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptClasses.mrt");
         Sti.Compile();
         Sti["lng_School_id"] = Frm_Main.School_id;
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         var Q       = (from a in db.tbl_Years orderby a.id descending select a).FirstOrDefault();
         int YearsId = 0;
         if (Q != null)
         {
             YearsId = Q.id;
         }
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptStudentClasses.mrt");
         Sti.Compile();
         Sti["int_Yearsid"] = YearsId;
         Sti["lng_Classid"] = Classid;
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }