protected void btnSearchStudent_Click(object sender, EventArgs e)
        {
            searchStatus.InnerText = ""; btnCreatePassword.Visible = false;
            if (txtStcode.Text.Trim() != "" && Business.Common.CommonBusiness.IsNumeric(txtStcode.Text))
            {
                Business.Common.LoginBusiness logBusiness = new Business.Common.LoginBusiness();

                var dt = logBusiness.SendUserPassword(txtStcode.Text.Trim(), txtNationalCode.Text.Trim(), "", true);
                if (dt.Rows.Count > 0)
                {
                    var lgn = logBusiness.User_Login(txtStcode.Text.Trim());
                    if (lgn != null && lgn.Password == null)
                    {
                        searchStatus.InnerText    = "";
                        btnCreatePassword.Visible = true;
                    }
                    else
                    {
                        searchStatus.InnerText = "برای این شماره دانشجویی قبلا پسورد ساخته شده است.";
                    }
                }
                else
                {
                    searchStatus.InnerText = "دانشجویی با اطلاعات وارد شده یافت نشد";
                }
            }
            else
            {
                searchStatus.InnerText = "شماره دانشجویی وارد شده نامعتبر می باشد";
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_Karbar] == null)
            {
                Response.Redirect("~/CommonUI/LoginRequestCMS.aspx");
                return;
            }
            manageAccessControl();
            if (!IsPostBack)
            {
                ViewState[userType] = 0;

                Business.Common.LoginBusiness lngB = new Business.Common.LoginBusiness();
                DataTable userdt  = lngB.Get_UserRoles(Session[sessionNames.userID_Karbar].ToString());
                DataRow[] drRoles = userdt.Select("roleId in(" + (int)DTO.RoleEnums.مدیر_ارشد + "," + (int)DTO.RoleEnums.مسئول_حق_التدریس + "," + (int)DTO.RoleEnums.مسئول_کارگزینی_هیات_علمی + "," + (int)DTO.RoleEnums.مدیر_امور_کارگزینی_هیئت_علمی + "," + (int)DTO.RoleEnums.سرپرست_واحد + ")");
                if (drRoles.Length > 0)
                {
                    ViewState[userType] = drRoles[0]["roleId"].ToString();
                }
                //rol = Convert.ToInt32(userdt.Rows[0][1]);

                fillCartable();
                setDDlTermSource(ddlContractType.SelectedItem.Value == "1");
                //RadWindowManager1.RadAlert("Test", 300, 100, "پیام سیستم", null);
            }
        }