protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
                List <MahaleSodoor>     dtVahed     = reqBusiness.GetListOfVahed();
                List <Field>            dtReshte    = GetListOfReshte();
                List <Daneshkade>       dtDanesh    = GetListOfCollege();
                drpVahed.DataSource     = dtVahed;
                drpVahed.DataTextField  = "Vahed";
                drpVahed.DataValueField = "Id";
                drpVahed.DataBind();
                drpFild.DataSource     = dtReshte;
                drpFild.DataTextField  = "field";
                drpFild.DataValueField = "Id";
                drpFild.DataBind();
                drpUniversity.DataSource     = dtDanesh;
                drpUniversity.DataTextField  = "daneshkade";
                drpUniversity.DataValueField = "Id";
                drpUniversity.DataBind();
                drpMadrak.Items.Add(new Telerik.Web.UI.RadComboBoxItem("گواهی موقت", "1"));
                drpMadrak.Items.Add(new Telerik.Web.UI.RadComboBoxItem("دانشنامه", "2"));
                drpMadrak.Items.Add(new Telerik.Web.UI.RadComboBoxItem("ریز نمرات", "3"));
            }

            //RegPcal1();
            //RegPcal2();
            //RegPcal3();
            //RegPcal4();
        }
Example #2
0
        private IEnumerable <ListReqVahed> GetData()
        {
            CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
            var idVahed     = drpUniversity.SelectedItem.Value;
            var startDate   = StartDateTxt.Text;
            var endDate     = EndDateTxt.Text;
            var MadrakType  = 2;
            var listByVahed = reqBusiness.GetListOFRequestByVahedAndDate(Convert.ToInt32(idVahed), startDate, endDate, Convert.ToInt32(MadrakType));
            var vahedList   = RequestHandler.ConvertDataTableToList <ListReqVahed>(listByVahed);

            switch (drpReportType.SelectedItem.Value)
            {
            case "1":
                return(vahedList.Where(w => w.DateApprovePay == null && w.DateSendToPay == null));

            case "2":
                return(vahedList.Where(w => w.DateSendToPay != null));

            case "3":
                return(vahedList);
            }
            //if (drpReportType.SelectedItem.Value == "1")
            //return vahedList.Where(w => w.DateApprovePay == null && w.DateSendToPay == null);
            //else
            return(vahedList.Where(w => w.DateSendToPay != null));
        }
        private void BindGrid()
        {
            CheckOutRequestBusiness business = new CheckOutRequestBusiness();
            var dt = business.GetListOFRequestByNextStatusForFaregh((int)(CheckOutStatusEnum.CheckOutAllStatusEnum.end));

            grd_Students.DataSource = dt;
            grd_Students.DataBind();
            GridFilterMenu menu = grd_Students.FilterMenu;

            filterMenu(menu);
        }
        protected void btnConfirm_Click1(object sender, EventArgs e)
        {
            CommonBusiness          commonBusiness = new CommonBusiness();
            CheckOutRequestBusiness reqBusiness    = new CheckOutRequestBusiness();
            var userID  = Session[sessionNames.userID_Karbar].ToString();
            var reqList = (List <int>)ViewState["studentRequestList"];

            if (reqList != null && reqList.Count > 0)
            {
                reqBusiness.SetDateApprove(reqList, Convert.ToInt32(userID), commonBusiness.GetIPAddress());
            }
            grdResualtList.Rebind();
        }
        protected void btnGraduateDocument_Click(object sender, EventArgs e)
        {
            string name = DateTime.Now.ToPeString().Replace("/", "") + " - " + "کد بایگانی مدارک فارغ التحصیلی";
            CheckOutRequestBusiness business = new CheckOutRequestBusiness();

            var dt = business.getAllArchiveID_GraduateDocuments();
            var ms = DataTableToExcelXlsx(dt, "کد بایگانی مدارک");

            ms.WriteTo(Response.OutputStream);
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            Response.AddHeader("Content-Disposition", "attachment;filename=" + name + ".xlsx");
            Response.StatusCode = 200;
            Response.End();
        }
        protected void btnReportCodeBayegani_Click(object sender, EventArgs e)
        {
            string name = DateTime.Now.ToPeString().Replace("/", "") + " - " + "کد بایگانی دانشجویان(جایگزین سیدا)";
            CheckOutRequestBusiness business = new CheckOutRequestBusiness();

            var dt = business.getAllCodeBayegan();
            var ms = DataTableToExcelXlsx(dt, "کد بایگانی دانشجویان");

            ms.WriteTo(Response.OutputStream);
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            Response.AddHeader("Content-Disposition", "attachment;filename=" + name + ".xlsx");
            Response.StatusCode = 200;
            Response.End();
        }
        protected void grdResult_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridViewRow  currentRow   = (GridViewRow)(((Button)e.CommandSource).NamingContainer);
            DropDownList drpReqStatus = (DropDownList)currentRow.FindControl("drpReqStatus") as DropDownList;

            reqID  = Convert.ToInt32(currentRow.Cells[1].Text);
            stcode = currentRow.Cells[2].Text;
            stName = currentRow.Cells[3].Text;

            ViewState.Add("stcode", stcode);
            ViewState.Add("stName", stName);
            ViewState.Add("reqID", reqID);

            if (e.CommandName == "History")
            {
                CommonBusiness cmb = new CommonBusiness();

                lst_history.DataSource = cmb.GetUserLogByModifyId(int.Parse(e.CommandArgument.ToString()), 12);
                lst_history.DataBind();

                info1.InnerText = "نام دانشجو:" + ViewState["stName"].ToString();
                info2.InnerText = "شماره درخواست:" + ViewState["reqID"].ToString();

                stcode = ViewState["stCode"].ToString();
                stName = ViewState["stName"].ToString();
                reqID  = Convert.ToInt32(ViewState["reqID"]);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
            }

            if (e.CommandName == "Deny")
            {
                string message;
                CheckOutRequestBusiness CheckBusiness = new CheckOutRequestBusiness();
                dt = (DataTable)ViewState["dt"];
                GridViewRow row           = grdResult.Rows[0];
                int         eraeBe        = 5;
                int         currentStatus = 5;
                int         reqType       = Convert.ToInt32(dt.Rows[0]["RequestTypeID"]);
                TextBox     txtDenyReason = (TextBox)grdResult.Rows[0].Cells[6].FindControl("txtDenyReason");
                message = business.DenyCheckOutRequestByCurrentStatus(Session[sessionNames.userID_Karbar].ToString(), currentStatus, eraeBe, reqID, reqType);
                business.SendMessage(Session[sessionNames.userID_Karbar].ToString(), reqID, txtDenyReason.Text);
                CheckBusiness.DeleteCheckOutFromFraghat(reqID);
                txtDenyReason.Text = "";

                RadWindowManager1.RadAlert(message, 0, 100, " پیام سیستم", "");
                BindGrid();
            }
        }
Example #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
         List <MahaleSodoor>     dtVahed     = reqBusiness.GetListOfVahed();
         dtVahed.Add(new MahaleSodoor {
             Id = 0, Vahed = "همه موارد"
         });
         drpUniversity.DataSource     = dtVahed.OrderBy(x => x.Id);
         drpUniversity.DataTextField  = "vahed";
         drpUniversity.DataValueField = "id";
         drpUniversity.DataBind();
     }
 }
        public static string VahedSodoor(this string idVahed)
        {
            CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();

            if (!string.IsNullOrEmpty(idVahed))
            {
                var dt = reqBusiness.GetNameOfVahedByVahedID(Convert.ToInt32(idVahed));
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["vahed"].ToString() != "Null")
                    {
                        return(dt.Rows[0]["vahed"].ToString());
                    }
                }
            }

            return("--");
        }
Example #10
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            CommonBusiness          CommonBusiness = new CommonBusiness();
            CheckOutRequestBusiness reqBusiness    = new CheckOutRequestBusiness();
            var userID  = Session[sessionNames.userID_Karbar].ToString();
            var reqList = (List <int>)ViewState["studentRequestList"];

            if (reqList != null && reqList.Count > 0)
            {
                reqBusiness.SetSendToPay(reqList, Convert.ToInt32(userID), CommonBusiness.GetIPAddress());
            }
            foreach (int i in reqList)
            {
                CommonBusiness.InsertIntoUserLog(Convert.ToInt32(Session[sessionNames.userID_Karbar]), DateTime.Now.ToString("HH:mm"), 12, (int)DTO.eventEnum.ارسال_جهت_پرداخت_به_واحد_صادرکننده, "", i);
            }
            grdResualtList.Rebind();
            ScriptManager.RegisterStartupScript(this, GetType(), "close", "CloseModal();", true);
        }
        private IEnumerable <ListReqVahed> GetData()
        {
            CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
            var idVahed     = drpUniversity.SelectedItem.Value;
            var startDate   = StartDateTxt.Text;
            var endDate     = EndDateTxt.Text;
            var MadrakType  = drpTypeMadrak.SelectedItem.Value;
            var listByVahed = reqBusiness.GetListOFRequestByVahedAndDate(Convert.ToInt32(idVahed), startDate, endDate, Convert.ToInt32(MadrakType));
            var vahedList   = RequestHandler.ConvertDataTableToList <ListReqVahed>(listByVahed);

            //var fareghNull = reqBusiness.GetListOFApproveList();
            //var nullFaregh = RequestHandler.ConvertDataTableToList<ApproveList>(fareghNull);
            //return from x in nullFaregh
            //          where x.ApproveDateMali == null
            //          join y in vahedList
            //          on x.StudentRequestId equals y.StudentRequestID
            //          select y;
            return(vahedList.Where(w => w.DateApprovePay == null && w.DateSendToPay != null));



            //return nullFaregh.Join(nullFaregh, vahed=> vahed.StudentRequestId, faregh=> faregh.StudentRequestId, (vahed, faregh) => new );//vahedList.Where(w => !nullFaregh.Contains(w.StudentRequestID));
        }
Example #12
0
        private IEnumerable <ListReqVahed> GetData()
        {
            CheckOutRequestBusiness reqBusiness = new CheckOutRequestBusiness();
            var idVahed     = drpUniversity.SelectedItem.Value;
            var startDate   = StartDateTxt.Text;
            var endDate     = EndDateTxt.Text;
            var MadrakType  = 2;
            var listByVahed = reqBusiness.GetListOFRequestByVahedAndDate(Convert.ToInt32(idVahed), startDate, endDate, Convert.ToInt32(MadrakType));
            var vahedList   = RequestHandler.ConvertDataTableToList <ListReqVahed>(listByVahed);

            //var fareghNull = reqBusiness.GetListOFApproveList();
            //var nullFaregh = RequestHandler.ConvertDataTableToList<ApproveList>(fareghNull)
            //    .Where(w=> w.ApproveDateFaregh != null && w.ApproveDateMali != null)
            //    .Select(s => s.StudentRequestId);
            switch (drpReportType.SelectedItem.Value)
            {
            case "1":
                return(vahedList.Where(w => w.DateApprovePay != null && w.DateSendToPay != null));   //nullFaregh.Contains(w.StudentRequestID)

            case "2":
                return(vahedList);
            }
            return(vahedList.Where(w => w.DateApprovePay != null && w.DateSendToPay != null));//nullFaregh.Contains(w.StudentRequestID)
        }
        private StiReport CreateDefenceSessionReport_Manual(string requestId, string studentCode, int defenceSessionDate, string defenceDate, bool bySign = false)
        {
            CheckOutRequestBusiness _reqBusiness = new CheckOutRequestBusiness();
            var entryYear = _reqBusiness.GetSaleVoroodByStCode(studentCode);

            StiReport rpt = new StiReport();

            if (!bySign)
            {
                if (Convert.ToUInt32(entryYear) < 95)
                {
                    //کمی
                    rpt.Load(Server.MapPath("../report/QuantityDefenceSession_Manual.mrt"));
                }
                else
                {
                    //کیفی
                    rpt.Load(Server.MapPath("../report/QualityDefenceSession_Manual.mrt"));
                }
                rpt.Dictionary.Databases.Clear();

                rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.SupplementaryReportConnection));
                rpt.Compile();
                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@stcode"]
                .ParameterValue =
                    studentCode;
                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@requestId"]
                .ParameterValue = Convert.ToInt32(requestId);

                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@defenceSessionDate"]
                .ParameterValue = defenceSessionDate;

                rpt["defenceDate"] = defenceDate;
                return(rpt);
            }
            else
            {
                if (Convert.ToUInt32(entryYear) < 95)
                {
                    //کمی
                    rpt.Load(Server.MapPath("../report/QuantityDefenceSession_Manual_BySign.mrt"));
                }
                else
                {
                    //کیفی
                    rpt.Load(Server.MapPath("../report/QualityDefenceSession_Manual_BySign.mrt"));
                }
                rpt.Dictionary.Databases.Clear();

                rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.SupplementaryReportConnection));
                rpt.Compile();
                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@stcode"]
                .ParameterValue =
                    studentCode;
                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@requestId"]
                .ParameterValue = Convert.ToInt32(requestId);

                rpt.CompiledReport
                .DataSources["[Resource_Control].[GetDefenceSessionInformation]"]
                .Parameters["@defenceSessionDate"]
                .ParameterValue = defenceSessionDate;

                rpt["defenceDate"] = defenceDate;
                RequestHandler _requestHandler = new RequestHandler();
                var            address         = Request.Url.OriginalString.Replace(Request.Url.PathAndQuery, "") + Request.ApplicationPath; //Server.MapPath("../../").ToString();
                var            signs           = _requestHandler.GetSignutreOstadByImage(studentCode, address).OrderBy(c => c.IdTypeOs);
                var            score           = _requestHandler.GetScoreForDefence(Convert.ToInt32(requestId));

                rpt["modirSign"]   = signs.Where(c => c.IdTypeOs == 1)?.FirstOrDefault()?.singAddress;
                rpt["osMoshSign"]  = signs.Where(c => c.IdTypeOs == 2)?.FirstOrDefault()?.singAddress;
                rpt["osRahSign"]   = signs.Where(c => c.IdTypeOs == 3)?.FirstOrDefault()?.singAddress;
                rpt["osDavInSign"] = signs.Where(c => c.IdTypeOs == 4)?.FirstOrDefault()?.singAddress;
                rpt["osDOSign"]    = signs.Where(c => c.IdTypeOs == 5)?.FirstOrDefault()?.singAddress;

                if (Convert.ToUInt32(entryYear) < 95)
                {
                    //کمی
                    rpt["Score"]        = (score.Score);
                    rpt["ScoreLetters"] = score.ScoreLetters;
                }
                else
                {
                    //کیفی
                    rpt["Degree"] = UtilityFunction.ConvertScoreToDegree((score.Score == null ? -1 : score.Score.Value));
                }
                return(rpt);
            }
        }
        private void setFeraghatPopup(int reqId, string studentName, string stcode)
        {
            txtRizNomre.Text             = "";
            txtGovahiMovaghat.Text       = "";
            txtDaneshname.Text           = "";
            txtSodoorDaneshname.Text     = "";
            TxtSodoorGovahiMovaghat.Text = "";
            txtSodoorRizNomre.Text       = "";
            txtErsalRizNomre.Text        = "";
            if (Convert.ToBoolean(bsn.ExistRiz(reqId)))
            {
                btnReceiptRiz.Enabled       = false;
                hdnRiznomre.Value           = signatureImage(1, reqId);
                dvSignatureRiznomre.Visible = true;
            }
            else
            {
                btnReceiptRiz.Enabled       = true;
                hdnRiznomre.Value           = "";
                dvSignatureRiznomre.Visible = false;
            }
            if (Convert.ToBoolean(bsn.ExistGovahi(reqId)))
            {
                btnReceiptGovahi.Enabled  = false;
                hdnGovahi.Value           = signatureImage(2, reqId);
                dvSignatureGovahi.Visible = true;
            }
            else
            {
                btnReceiptGovahi.Enabled  = true;
                hdnGovahi.Value           = null;
                dvSignatureGovahi.Visible = false;
            }
            if (Convert.ToBoolean(bsn.ExistDanesh(reqId)))
            {
                btnReceiptDanesh.Enabled      = false;
                hdnDaneshname.Value           = signatureImage(3, reqId);
                dvSignatureDaneshname.Visible = true;
            }
            else
            {
                btnReceiptDanesh.Enabled      = true;
                hdnDaneshname.Value           = "";
                dvSignatureDaneshname.Visible = false;
            }
            lblStName.Text = studentName;
            lblStcode.Text = stcode;
            ViewState.Add("reqId", reqId.ToString());
            hdnfReqId.Value      = reqId.ToString();
            hdnfFeraghatId.Value = 0.ToString();
            FeraghatTahsilBusiness bFeraghat = new FeraghatTahsilBusiness();
            FeraghatTahsilDTO      oFeraghat = bFeraghat.GetFeraghatMadrekStatus(reqId);


            hdnReqID.Value = reqId.ToString();
            if (oFeraghat != null)
            {
                lblArchiveDanesh.Text   = oFeraghat.archiveCode_daneshname == 0 ? "-" : oFeraghat.archiveCode_daneshname.ToString();
                lblArchiveMovaghat.Text = oFeraghat.archiveCode_movaghat == 0 ? "-" : oFeraghat.archiveCode_movaghat.ToString();
                lblArchiveRiz.Text      = oFeraghat.archiveCode_rizNomre == 0 ? "-" : oFeraghat.archiveCode_rizNomre.ToString();
                if (oFeraghat.RizNomarat > 0)
                {
                    chbkRizNomarat.Checked = true;

                    if (oFeraghat.DateRizNomarat != null)
                    {
                        txtRizNomre.Text = oFeraghat.DateRizNomarat;
                    }
                    if (oFeraghat.dateSodoorRizNomre != null)
                    {
                        txtSodoorRizNomre.Text = oFeraghat.dateSodoorRizNomre;
                    }
                    if (oFeraghat.dateErsalRizNomre != null)
                    {
                        txtErsalRizNomre.Text = oFeraghat.dateErsalRizNomre;
                    }
                }
                else
                {
                    chbkRizNomarat.Checked = false;
                    if (oFeraghat.dateErsalRizNomre != null)
                    {
                        txtErsalRizNomre.Text = oFeraghat.dateErsalRizNomre.ToString();
                    }
                    if (oFeraghat.dateSodoorRizNomre != null)
                    {
                        txtSodoorRizNomre.Text = oFeraghat.dateSodoorRizNomre.ToString();
                    }
                    if (oFeraghat.DateRizNomarat != null)
                    {
                        txtRizNomre.Text = oFeraghat.DateRizNomarat.ToString();
                    }
                }

                if (oFeraghat.GovahiMovaghat > 0)
                {
                    chbkGovahiMovaghat.Checked = true;
                    if (oFeraghat.DateGovahiMovaghat != null)
                    {
                        txtGovahiMovaghat.Text = oFeraghat.DateGovahiMovaghat;
                    }
                    if (oFeraghat.dateSodoorGovahi != null)
                    {
                        TxtSodoorGovahiMovaghat.Text = oFeraghat.dateSodoorGovahi;
                    }
                }
                else
                {
                    chbkGovahiMovaghat.Checked = false;

                    if (oFeraghat.DateGovahiMovaghat != null)
                    {
                        txtGovahiMovaghat.Text = oFeraghat.DateGovahiMovaghat.ToString();
                    }
                    if (oFeraghat.dateSodoorGovahi != null)
                    {
                        TxtSodoorGovahiMovaghat.Text = oFeraghat.dateSodoorGovahi.ToString();
                    }
                }

                if (oFeraghat.DaneshNameh > 0)
                {
                    chbkDaneshNameh.Checked = true;
                    if (oFeraghat.DateDaneshNameh != null)
                    {
                        txtDaneshname.Text = oFeraghat.DateDaneshNameh;
                    }
                    if (oFeraghat.dateSodoorDaneshname != null)
                    {
                        txtSodoorDaneshname.Text = oFeraghat.dateSodoorDaneshname;
                    }
                }
                else
                {
                    chbkDaneshNameh.Checked = false;
                    if (oFeraghat.DateDaneshNameh != null)
                    {
                        txtDaneshname.Text = oFeraghat.DateDaneshNameh.ToString();
                    }
                    if (oFeraghat.dateSodoorDaneshname != null)
                    {
                        txtSodoorDaneshname.Text = oFeraghat.dateSodoorDaneshname.ToString();
                    }
                }

                hdnfFeraghatId.Value = oFeraghat.Id.ToString();
                btnCreateArchiveCode_MadrakMovaghat.Visible = (oFeraghat.archiveCode_movaghat == 0 && oFeraghat.DateGovahiMovaghat == "");
                btnCreateArchiveCode_Daneshname.Visible     = (oFeraghat.archiveCode_daneshname == 0 && oFeraghat.DateDaneshNameh == "");
                btnCreateArchiveCode_Riznomre.Visible       = (oFeraghat.archiveCode_rizNomre == 0 && oFeraghat.DateRizNomarat == "");
            }
            else
            {
                chbkRizNomarat.Checked     = false;
                chbkGovahiMovaghat.Checked = false;
                chbkDaneshNameh.Checked    = false;
                btnCreateArchiveCode_MadrakMovaghat.Visible = true;
                btnCreateArchiveCode_Daneshname.Visible     = true;
                btnCreateArchiveCode_Riznomre.Visible       = true;
                lblArchiveDanesh.Text   = "-";
                lblArchiveMovaghat.Text = "-";
                lblArchiveRiz.Text      = "-";
            }
            CheckOutMaliBusiness MaliBusiness = new CheckOutMaliBusiness();

            if (MaliBusiness.HasAnyRefahDebit(lblStcode.Text))
            {
                vamdarBanner.Visible = true;
            }
            else
            {
                vamdarBanner.Visible = false;
            }
            CheckOutRequestBusiness reqBus = new CheckOutRequestBusiness();
            var mash = reqBus.isMashmoolferaghat(lblStcode.Text);

            if (mash != null)
            {
                if (mash > 0)
                {
                    mashmoolBanner.Visible = true;
                }
                else
                {
                    mashmoolBanner.Visible = false;
                }
            }
        }
        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);
        }
Example #16
0
        protected void modalOpenScore_Click(object sender, EventArgs e)
        {
            btnAccept.Visible    = false;
            btnRejectOrDisp.Text = "بستن";

            lblModalTitle.Text = "تاییدیه نمره دفاع توسط اساتید";
            Button btn = (Button)sender;

            user = "******" + Session[sessionNames.userID_StudentOstad].ToString();
            GridDataItem data      = (GridDataItem)btn.NamingContainer;
            var          lblReqid  = data.FindControl("lblRequestId") as Label;
            var          lblStCode = data.FindControl("lblstudentcode") as Label;

            hdnReqId.Value  = lblReqid.Text;
            hdnStcode.Value = lblStCode.Text;
            resScore        = _requestHandler.GetScoreForDefence(int.Parse(lblReqid.Text));
            if (resScore.Score == null || resScore.Score < 0 || resScore.Score > 20)
            {
                lblTitle.Text = "پیام سیستم";
                lblAlert.Text = "نمره ای جهت تایید درج نشده است";
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal2", "$('#ModalAlert').modal();", true);
                upModalAlert.Update();
                return;
            }
            CheckOutRequestBusiness _reqBusiness = new CheckOutRequestBusiness();
            var entryYear = _reqBusiness.GetSaleVoroodByStCode(lblStCode.Text);

            if (Convert.ToInt32(entryYear) < 95)
            {
                lblScore.Text = resScore.Score.ToString();
            }
            else
            {
                lblScore.Text = UtilityFunction.ConvertScoreToDegree((resScore.Score == null ? -1 : resScore.Score.Value));
            }

            var resDefOstads = _requestHandler.GetDefenceInformation(lblStCode.Text);

            if (resDefOstads.FirstConsultantId != "" && resDefOstads.FirstConsultantId != null)
            {
                PanelMosh1.Visible = true;
                chkMosh1.Checked   = resScore.FlagAcceptScoreMosh1.Value;
                if (user == resDefOstads.FirstConsultantId && !resScore.FlagAcceptScoreMosh1.Value)
                {
                    chkMosh1.Enabled     = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkMosh1.Enabled = false;
                }
            }

            else
            {
                PanelMosh1.Visible = false;
                chkMosh1.Checked   = true;
            }



            if (resDefOstads.SecondConsultantId != "" && resDefOstads.SecondConsultantId != null)
            {
                PanelMosh2.Visible = true;
                chkMosh2.Checked   = resScore.FlagAcceptScoreMosh2.Value;
                if (user == resDefOstads.SecondConsultantId && !resScore.FlagAcceptScoreMosh2.Value)
                {
                    chkMosh2.Enabled     = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkMosh2.Enabled = false;
                }
            }
            else
            {
                PanelMosh2.Visible = false;
                chkMosh2.Checked   = true;
            }

            if (resDefOstads.FirstGuideId != "" && resDefOstads.FirstGuideId != null)
            {
                PanelRah1.Visible = true;
                chkRah1.Checked   = resScore.FlagAcceptScoreRah1.Value;
                if (user == resDefOstads.FirstGuideId && !resScore.FlagAcceptScoreRah1.Value)
                {
                    chkRah1.Enabled      = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkRah1.Enabled = false;
                }
            }
            else
            {
                PanelRah1.Visible = false;
                chkRah1.Checked   = true;
            }
            if (resDefOstads.SecondGuideId != "" && resDefOstads.SecondGuideId != null)
            {
                PanelRah2.Visible = true;
                chkRah2.Checked   = resScore.FlagAcceptScoreRah2.Value;
                if (user == resDefOstads.SecondGuideId && !resScore.FlagAcceptScoreRah2.Value)
                {
                    chkRah2.Enabled      = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkRah2.Enabled = false;
                }
            }
            else
            {
                PanelRah2.Visible = false;
                chkRah2.Checked   = true;
            }
            if (resDefOstads.FirstRefereeId != "" && resDefOstads.FirstRefereeId != null)
            {
                PanelDav1.Visible = true;
                chkDav1.Checked   = resScore.FlagAcceptScoreDavin.Value;
                if (user == resDefOstads.FirstRefereeId && !resScore.FlagAcceptScoreDavin.Value)
                {
                    chkDav1.Enabled      = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkDav1.Enabled = false;
                }
            }
            else
            {
                PanelDav1.Visible = false;
                chkDav1.Checked   = true;
            }
            if (resDefOstads.SecondRefereeId != "" && resDefOstads.SecondRefereeId != null)
            {
                PanelDav2.Visible = true;
                chkDav2.Checked   = resScore.FlagAcceptScoreDavOut.Value;
                if (user == resDefOstads.SecondRefereeId && !resScore.FlagAcceptScoreDavOut.Value)
                {
                    chkDav2.Enabled      = true;
                    btnAccept.Visible    = true;
                    btnRejectOrDisp.Text = "انصراف";
                }
                else
                {
                    chkDav2.Enabled = false;
                }
            }
            else
            {
                PanelDav2.Visible = false;
                chkDav2.Checked   = true;
            }

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal1", "$('#ModalAcceptScore').modal();", true);
            //upModalAccept.Update();
        }