Esempio n. 1
0
        private void prv_Check_UserSignIn()
        {
            cl_GlobalVariables.pcl_UserData lcl_UD = new cl_GlobalVariables.pcl_UserData();
            Object lo_UserData = Session["user_data"];

            if (lo_UserData != null)
            {
                lcl_UD = (cl_GlobalVariables.pcl_UserData)lo_UserData;
                LinkButton_UserName.Text     = "Добро пожаловать: " + lcl_UD.Login.ToString();
                LinkButton_UserName.Visible  = true;
                ImageButton_userexit.Visible = true;
                Button_Registr.Visible       = false;
                Button_SignIn.Visible        = false;
            }
        }
Esempio n. 2
0
        protected void butt_SignIn_Click(object sender, EventArgs e)
        {
            String         ls_Login = TextBox_SignIn_Login.Text;
            String         ls_Pass  = TextBox_SignIn_Pass.Text;
            List <TextBox> list_Box = new List <TextBox>();

            list_Box.Add(TextBox_SignIn_Login);
            list_Box.Add(TextBox_SignIn_Pass);
            Boolean lb_Check = true;

            foreach (TextBox ltb_Box in list_Box)
            {
                if (prb_Check_TextBox_EmptyOrSpace(ltb_Box) == false)
                {
                    lb_Check = false;
                }
            }
            if (lb_Check == true)
            {
                DataTable ldt = g_SQL.pdt_Autorization(ls_Login, g_CR.ps_MD5(ls_Pass), g_GV.gs_RegistrBasePath());
                if (ldt.Rows.Count > 0)
                {
                    if (ldt.Rows[0]["attribute"].ToString() == "mail_confirm")
                    {
                        Label_SignIn_Error.Text = "вы не подтвердили свою учетную запись!";
                    }
                    else
                    {
                        cl_GlobalVariables.pcl_UserData lcl_UD = new cl_GlobalVariables.pcl_UserData();
                        lcl_UD.Login = ldt.Rows[0]["Login"].ToString();
                        lcl_UD.UID   = ldt.Rows[0]["UID"].ToString();
                        Session.Add("user_data", (object)lcl_UD);
                        Response.Redirect("default.aspx");
                    }
                }

                if (ldt.Rows.Count == 0)
                {
                    Label_SignIn_Error.Text = "неверно указаны логин и/или пароль!";
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cl_GlobalVariables.pcl_UserData lcl_UD = new cl_GlobalVariables.pcl_UserData();
            Object lo_user_data = Session["user_data"];

            if (lo_user_data == null)
            {
                Label_error.Text = "Ошибка x0.05: неверное значение!";
            }
            else
            {
                lcl_UD = (cl_GlobalVariables.pcl_UserData)lo_user_data;
                if (Session["panel_user_data"] == null)
                {
                    prv_ReadUserData(lcl_UD.UID);
                }
                else
                {
                    DataRow ldr_temp = (DataRow)Session["panel_user_data"];
                    if (ldr_temp["Login"].ToString() != lcl_UD.Login)
                    {
                        prv_ReadUserData(lcl_UD.UID);
                    }
                }
                DataRow ldr_row = (DataRow)Session["panel_user_data"];
                Panel_info.Visible     = true;
                Label_Name.Text        = "Имя: " + ldr_row["Name"].ToString();
                Label_Surname.Text     = "Фамилия: " + ldr_row["Surname"].ToString();
                Label_Login.Text       = "Логин: " + ldr_row["Login"].ToString();
                Label_RegistrDate.Text = "Дата регистрации: " + ldr_row["Date"].ToString();
                Label_Mail.Text        = "Адрес электронной почты: " + ldr_row["Mail"].ToString();
                Label_Permission.Text  = "Права доступа: " + ldr_row["Permission"].ToString();

                if (ldr_row["Permission"].ToString() == "administrator")
                {
                    LinkButton_ShowRegistrBase.Visible = true;
                }
            }
        }