protected void ClickedME(object sender, EventArgs e)
        {
            List <LoginDTO> userDTO = new List <LoginDTO>();

            DataTable dt = new DataTable();

            if (Page.IsValid)
            {
                LoginBusiness lngB = new LoginBusiness();
                userDTO = lngB.Get_UserLogin(UserName.Text, password.Text);


                if (userDTO.Count > 0)
                {
                    Session[sessionNames.userID_Karbar] = userDTO[0].UserId;
                    Session["Enable"] = userDTO[0].Enable;
                    Session[sessionNames.userName_Karbar] = userDTO[0].Name;
                    Session[sessionNames.roleID]          = userDTO[0].RoleId;
                    Session[sessionNames.sectionID]       = userDTO[0].sectionId;
                    Session[sessionNames.user_Karbar]     = userDTO[0].UserName;
                    Session[sessionNames.roleText]        = userDTO[0].RoleName;
                    if (Convert.ToBoolean(Session["Enable"].ToString()))
                    {
                        var gm = CommonBusiness.GetGroupMangerInformation(userDTO[0].UserName);
                        if (gm.Count > 0)
                        {
                            Business.university.Research.ResearchBusiness Rbusiness = new Business.university.Research.ResearchBusiness();
                            Session["IsGroupManger"] = true;
                            var lgn = Rbusiness.GetTeacherUserPass(int.Parse(gm[0].ProfessorCode.ToString()));
                            Session["Password"]     = CommonBusiness.DecryptPass(lgn.Rows[0]["Password"].ToString());
                            Session["IsOstad"]      = true;
                            Session["UserType_lms"] = 2;
                        }
                        Session["p"]            = CommonBusiness.DecryptPass(userDTO[0].Password);
                        Session["UserType_lms"] = 1;
                        Response.Redirect("CommonCmsIntro.aspx");

                        //CommonBusiness.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.Date, DateTime.Now.ToShortTimeString(), "0", 14);
                    }
                    else
                    {
                        errormsg.Visible   = true;
                        errormsg.InnerText = "نام کاربری یا رمز عبور صحیح نمی باشد";
                    }
                }
                else
                {
                    errormsg.Visible = true;
                }
                errormsg.InnerText = "نام کاربری یا رمز عبور صحیح نمی باشد";
            }
            else
            {
                errormsg.Visible   = true;
                errormsg.InnerText = "کد امنیتی صحیح وارد نشده است";
            }
        }
示例#2
0
 protected void btnDontPermit_Click(object sender, EventArgs e)
 {
     if (txtStcode.Text != "" && Business.Common.CommonBusiness.IsNumeric(txtStcode.Text))
     {
         Business.university.Research.ResearchBusiness b = new Business.university.Research.ResearchBusiness();
         b.dontPermitStudentToEnterPortal(txtStcode.Text);
     }
     else
     {
     }
     setPermitionDatasource();
 }
        protected void a_PortalPajoheshi_ServerClick(object sender, EventArgs e)
        {
            bool tempAccess = false;

            Business.university.Research.ResearchBusiness b = new Business.university.Research.ResearchBusiness();

            DataTable dtAllowEnterToPortal = b.PortalEntryPermition();
            var       studentPermit        = dtAllowEnterToPortal.Select("stcode='" + Session[sessionNames.userID_StudentOstad].ToString() + "'").Length > 0;

            //rwm_message.RadAlert("کاربر گرامی سامانه در حال بروزرسانی می باشد", null, 100, "پیام", "");
            if (dt_vaz.Rows[0]["idvazkol"].ToString() != "1" && dt_vaz.Rows[0]["idvazkol"].ToString() != "15" && !studentPermit)
            {
                rwm_message.RadAlert("شما به این آیتم دسترسی ندارید", null, 100, "پیام", "");
            }
            else
            {
                Response.Redirect("../../University/Research/Pages/ResearchMainPage.aspx");
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string usercode = Session[sessionNames.userID_StudentOstad].ToString();

            Business.university.Research.ResearchBusiness b = new Business.university.Research.ResearchBusiness();
            DataTable dtAllowEnterToPortal = b.PortalEntryPermition();
            var       studentPermit        = dtAllowEnterToPortal.Select("stcode='" + Session[sessionNames.userID_StudentOstad].ToString() + "'").Length > 0;

            //if (CommonBusiness.IsNumeric(usercode))
            //{
            DataTable dt = new DataTable();

            dt = Business.CheckStInSecondTerm(Session[sessionNames.userID_StudentOstad].ToString());
            DataTable stInfodt = new DataTable();

            stInfodt = stubausiness.GetStudentsInfo(usercode);
            //DataTable dtResh=new DataTable();
            //dtResh=Business.StInSomFields(int.Parse(stInfodt.Rows[0]["idresh"].ToString()));

            if (int.Parse(stInfodt.Rows[0]["grade"].ToString()) == 2 ||
                int.Parse(stInfodt.Rows[0]["grade"].ToString()) == 1 ||
                int.Parse(stInfodt.Rows[0]["grade"].ToString()) == 3 ||
                int.Parse(stInfodt.Rows[0]["grade"].ToString()) == 8)
            {
                rwm_Message.RadAlert(" فقط دانشجویان ارشد و دکتری می توانند از این سیستم استفاده نمایند", null, 100, "خطا", "CallBackConfirm");
            }
            else
            {
                bool tempAccess = false;
                if ((int.Parse(dt.Rows[0][0].ToString()) > 1 || studentPermit) && usercode.Length <= 9)
                {
                    //stInfodt = stubausiness.GetStudentsInfo(usercode);//etelaate daneshju khande mishavad

                    DataTable dts = new DataTable();
                    dts = Business.GetStudentFromStudentsByStcode(int.Parse(usercode)); //check mikonad daneshju ra darad ya na
                    if (dts.Rows.Count == 0)                                            //agar daneshju ra nadashtim ezafe kon
                    {
                        Business.InsertStudentInfoToStudents(int.Parse(usercode), stInfodt.Rows[0]["firstName"].ToString(), stInfodt.Rows[0]["lastName"].ToString()
                                                             , int.Parse(stInfodt.Rows[0]["enterYear"].ToString()), stInfodt.Rows[0]["nationalCode"].ToString(), int.Parse(stInfodt.Rows[0]["idresh"].ToString())
                                                             , int.Parse(stInfodt.Rows[0]["groupid"].ToString()), stubausiness.PersianCalander(), DateTime.Now.ToShortTimeString(), int.Parse(stInfodt.Rows[0]["grade"].ToString())
                                                             , stInfodt.Rows[0]["mobile"].ToString(), stInfodt.Rows[0]["homeAddress"].ToString(), int.Parse(stInfodt.Rows[0]["enterTerm"].ToString())
                                                             , stInfodt.Rows[0]["email"].ToString(), int.Parse(stInfodt.Rows[0]["gender"].ToString()), "def.png");
                    }
                    else
                    {
                        LoginBusiness logBusiness = new LoginBusiness();
                        logBusiness.updatePortalStudentInfo(Session[sessionNames.userID_StudentOstad].ToString());
                    }
                    e_Status.Value = "0";
                    form1.Action   = "http://thesis.iauec.ac.ir/Index.aspx";
                    userCode.Value = usercode;

                    e_Code.Value = "iauec_unit503";
                    ScriptManager.RegisterStartupScript(this, GetType(), "submitform", "submitform();", true);
                }
                else
                {
                    rwm_Message.RadAlert(" دانشجویانی که در ترم اول می باشند و یا ورودی 1399 به بعد هستند، نمی توانند از این سیستم استفاده نمایند", null, 100, "خطا", "CallBackConfirm");
                }
            }
        }
示例#5
0
 private void setPermitionDatasource()
 {
     Business.university.Research.ResearchBusiness b = new Business.university.Research.ResearchBusiness();
     grdPermit.DataSource = b.PortalEntryPermition();
     grdPermit.DataBind();
 }