Пример #1
0
        private DataTable getReport()
        {
            CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
            DataTable dt     = new DataTable();
            DataTable fields = new DataTable();

            fields.Columns.Add(new DataColumn("FieldId", typeof(int)));
            foreach (Telerik.Web.UI.RadComboBoxItem item in drpFild.Items)
            {
                if (item.Checked)
                {
                    var row = fields.NewRow();
                    row["FieldId"] = Convert.ToInt32(item.Value);
                    fields.Rows.Add(row);
                }
            }
            DataTable danesh = new DataTable();

            danesh.Columns.Add(new DataColumn("FieldId", typeof(int)));
            foreach (Telerik.Web.UI.RadComboBoxItem item in drpUniversity.Items)
            {
                if (item.Checked)
                {
                    var row = danesh.NewRow();
                    row["FieldId"] = Convert.ToInt32(item.Value);
                    danesh.Rows.Add(row);
                }
            }

            DataTable vahedList = new DataTable();

            vahedList.Columns.Add(new DataColumn("FieldId", typeof(int)));
            foreach (Telerik.Web.UI.RadComboBoxItem item in drpVahed.Items)
            {
                if (item.Checked)
                {
                    var row = vahedList.NewRow();
                    row["FieldId"] = Convert.ToInt32(item.Value);
                    vahedList.Rows.Add(row);
                }
            }


            var madrakTypeid   = Convert.ToInt32(drpMadrak.SelectedItem.Value);
            int idCaseStatus   = Convert.ToInt32(drpStatusCase.SelectedValue.ToString());
            int idMadrakStatus = Convert.ToInt32(drpStatusMadrak.SelectedValue.ToString());

            if (rdvoroodKartabl.Checked == true)
            {
                string sodoorstartDate = txtFromKartabl.Text.ToString().formatDateString();
                string sodoorEndDate   = txtToKartabl.Text.ToString().formatDateString();
                dt = reqBusiness.GetListOfCaseInKarTabl(vahedList, sodoorstartDate, sodoorEndDate, fields, danesh, idCaseStatus, idMadrakStatus, madrakTypeid);

                grd_Info.Visible       = true;
                ExcleExportBtn.Visible = true;
                RegPcal1();
            }
            else if (rdSodoor.Checked == true)
            {
                string sodoorstartDate = TxtFromSodoor.Text.ToString().formatDateString();
                string sodoorEndDate   = txtToSodoor.Text.ToString().formatDateString();
                dt = reqBusiness.GetListOfMadarekByDateSodoor(vahedList, sodoorstartDate, sodoorEndDate, fields, danesh, idCaseStatus, idMadrakStatus, madrakTypeid);
                grd_Info.Visible       = true;
                ExcleExportBtn.Visible = true;
                RegPcal2();
            }
            else if (rdVoroodMadrak.Checked == true)
            {
                string sodoorstartDate = txtFromVoroodMadrak.Text.ToString().formatDateString();
                string sodoorEndDate   = txtToDateVoroodMadrak.Text.ToString().formatDateString();
                dt = reqBusiness.GetListOfMadrakVoroodUni(vahedList, sodoorstartDate, sodoorEndDate, fields, danesh, idCaseStatus, idMadrakStatus, madrakTypeid);
                grd_Info.Visible       = true;
                ExcleExportBtn.Visible = true;
                RegPcal3();
            }
            else if (rdExitMadrak.Checked == true)
            {
                string sodoorstartDate = txtFromDateExit.Text.ToString().formatDateString();
                string sodoorEndDate   = txtToDateExit.Text.ToString().formatDateString();
                dt = reqBusiness.GetListOfExitCaseFromKartabl(vahedList, sodoorstartDate, sodoorEndDate, fields, danesh, idCaseStatus, idMadrakStatus, madrakTypeid);
                grd_Info.Visible       = true;
                ExcleExportBtn.Visible = true;
                RegPcal4();
            }
            else
            {
                var msg = "لطفا یکی از گزینه ها را انتخاب کنید";
                RadWindowManager1.RadAlert(msg, 300, 100, "پیام سیستم", "");
            }
            return(dt);
        }