Exemplo n.º 1
0
 private void btnEnter_Click(object sender, EventArgs e)
 {
     objDataAdapter.SelectCommand = new SqlCommand();
     objDataAdapter.SelectCommand.Connection = FrmEnter.objConnection;
     objDataAdapter.SelectCommand.Parameters.AddWithValue("@DeliveryDate" , "00/00/00");
     objDataAdapter.SelectCommand.Parameters.AddWithValue("@ProjectType", "طرح پژوهشی");
     objDataAdapter.SelectCommand.Parameters.AddWithValue("@DeliveryDate1", cboYear.Text + "%");
     objDataAdapter.SelectCommand.Parameters.AddWithValue("@StartDate", cboYear.Text + "%");
     objTbl.Clear();
     year = cboYear.Text;
     if (FrmSelectTypeGharardad.lnkProjectType1 == "طرح پژوهشی")
     {
         FrmProjectReportViewer objViewer = new FrmProjectReportViewer();
         if (rdbEjra.Checked == true)
         {
             ProjectFlag = 0;
             objDataAdapter.SelectCommand.CommandText = "Select * from VwProjectFlag where DeliveryDate = @DeliveryDate AND StartDate Like @StartDate AND ProjectType = @ProjectType " + FrmSelectTypeGharardad.QueryString;
             objDataAdapter.Fill(objTbl);
             objViewer.Show();
         }
         else if (rdbPayan.Checked == true)
         {
             ProjectFlag = 1;
             objDataAdapter.SelectCommand.CommandText = "Select * from VwProjectFlag where DeliveryDate != @DeliveryDate AND DeliveryDate Like @DeliveryDate1 AND ProjectType = @ProjectType " + FrmSelectTypeGharardad.QueryString;
             objDataAdapter.Fill(objTbl);
             objViewer.Show();
         }
         else if (rdbISGharardad.Checked == true)
         {
             FrmSelectTypeGharardad.GharardadFlag = 1;
             FrmReportViewerGharardad objGharardad = new FrmReportViewerGharardad();
             objGharardad.Show();
         }
     }
     else if (FrmSelectTypeGharardad.lnkProjectType1 == "پایان نامه")
     {
         FrmReportViewerThesisMain objViewer = new FrmReportViewerThesisMain();
         if (rdbEjra.Checked == true)
         {
             ProjectFlag = 0;
             objDataAdapter.SelectCommand.CommandText = "Select * from VwCommentThesis where DeliveryDate = @DeliveryDate AND StartDate Like @StartDate " + FrmSelectTypeGharardad.QueryString;
             objDataAdapter.Fill(objTbl);
             objViewer.Show();
         }
         else if (rdbPayan.Checked == true)
         {
             ProjectFlag = 1;
             objDataAdapter.SelectCommand.CommandText = "Select * from VwCommentThesis where DeliveryDate != @DeliveryDate AND DeliveryDate Like @DeliveryDate1 " + FrmSelectTypeGharardad.QueryString;
             objDataAdapter.Fill(objTbl);
             objViewer.Show();
         }
         else if (rdbISGharardad.Checked == true)
         {
             FrmReportViewerThesisGharardad objReport = new FrmReportViewerThesisGharardad();
             objReport.Show();
         }
     }
 }
 private void btnEnter_Click(object sender, EventArgs e)
 {
     try
     {
         if (lnkProjectType.Text == "طرح پژوهشی")
         {
             if (rdbISGharardad.Checked == true)
             {
                 FrmFlagProject objFlag = new FrmFlagProject();
                 objFlag.ShowDialog();
                 QueryString = "AND GharardadNumber != ''";
             }
             else
             {
                 year = cboYear.Text;
                 GharardadFlag = 0;
                 FrmReportViewerGharardad objReport = new FrmReportViewerGharardad();
                 objReport.Show();
             }
         }
         else if(lnkProjectType.Text == "پایان نامه")
         {
             if (rdbISGharardad.Checked == true)
             {
                 FrmFlagProject objFlag = new FrmFlagProject();
                 objFlag.ShowDialog();
                 QueryString = "AND GharardadNumber != ''";
             }
             else
             {
                 year = cboYear.Text;
                 GharardadFlag = 0;
                 FrmReportViewerThesisGharardad objReport = new FrmReportViewerThesisGharardad();
                 objReport.Show();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }