Esempio n. 1
0
        public string login(clsJsonMember.loginDetails obj)
        {
            System.Data.DataSet DS = objLogin.login(obj);
            string Det;

            if (DS.Tables[0].Rows.Count <= 0)
            {
                Det = "Incorrect";
            }
            else
            {
                Det = JsonConvert.SerializeObject(DS, Formatting.Indented);
            }
            return(Det);
        }
Esempio n. 2
0
        protected void btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (!validar())
                {
                    return;
                }

                clsLogin objlogin = new clsLogin(strnombreapp);
                objlogin.Username = int.Parse(txtusername.Value.Trim());
                objlogin.Password = txtpassword.Value.Trim();
                if (!objlogin.login())
                {
                    objlogin = null;
                    return;
                }
                switch (objlogin.Tipo_usuario)
                {
                case "cliente":
                    Session["identificacion"] = objlogin.Username;
                    Response.Redirect("frmCliente.aspx");
                    break;

                case "admin":
                    Session["identificacion"] = objlogin.Username;
                    Response.Redirect("frmadmin.aspx");
                    break;

                default:
                    mensajes("error", objlogin.Tipo_usuario);
                    break;
                }
            }
            catch (Exception ex)
            {
                mensajes("error", ex.Message);
            }
        }
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            objda.loginid  = txtloginid.Text;
            objda.password = txtpassword.Text;
            objda.company  = "HCLLP";
            objda.action   = "checkclientlogin";
            ds             = objda.login();

            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["clientloginid"]     = ds.Tables[0].Rows[0]["nid"].ToString();
                Session["clientname"]        = ds.Tables[0].Rows[0]["clientname"].ToString();
                Session["clientcompanyname"] = ds.Tables[0].Rows[0]["company"].ToString();
                Session["companyname"]       = ds.Tables[0].Rows[0]["companyname"].ToString();
                Session["companyid"]         = ds.Tables[0].Rows[0]["companyid"].ToString();

                Response.Redirect("Home.aspx");
            }
            else
            {
                GeneralMethod.alert(this, "Invalid Username or Password!");
            }
        }