Ejemplo n.º 1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtEmail.Value.Trim() == "")
            {
                MSG("กรุณาป้อน Email !!!");
                return;
            }
            if (txtPassword.Value.Trim() == "")
            {
                MSG("กรุณาป้อน Password !!!");
                return;
            }
            MODEL.Criteria.reqLogin req = new MODEL.Criteria.reqLogin();
            req.email    = txtEmail.Value.Trim();
            req.password = txtPassword.Value.Trim();

            MODEL.ResultLogin res = new MODEL.ResultLogin();
            res = svRestaurant.getLogin(req);
            if (res.ResultOk == "true")
            {
                //HttpContext.Current.Application["app_memberID"] = res.memberID;
                //HttpContext.Current.Application["app_restaurantID"] = res.restaurantID;
                Session["memberID"]     = res.memberID;
                Session["restaurantID"] = res.restaurantID;
                string URL = @"memberID=" + res.memberID + "&restaurantID=" + res.restaurantID;
                URL = svEncrypt.Encrypt(URL, "r0b1nr0y");
                Response.Redirect("~/Restaurant/DashboardCashier.aspx?" + URL);
            }
            else
            {
                MSG(res.ErroMessage);
            }
        }
Ejemplo n.º 2
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtMemberName.Value.Trim() == "")
            {
                MSG("กรุณาป้อน ชื่อ !!!");
                return;
            }
            if (txtEmail.Value.Trim() == "")
            {
                MSG("กรุณาป้อน Email !!!");
                return;
            }
            if (txtPassword.Value.Trim() == "")
            {
                MSG("กรุณาป้อน Password !!!");
                return;
            }
            if (txtRePassword.Value.Trim() == "")
            {
                MSG("กรุณาป้อน Re-Password !!!");
                return;
            }
            if (txtPassword.Value.Trim() != txtRePassword.Value.Trim())
            {
                MSG("Password not match !!!");
                return;
            }
            MODEL.Criteria.reqLogin model = new MODEL.Criteria.reqLogin();
            model.username = txtMemberName.Value.Trim();
            model.email    = txtEmail.Value.Trim();
            model.password = txtPassword.Value.Trim();

            MODEL.ResultLogin res = new MODEL.ResultLogin();

            res = svRestaurant.insertMember(model);
            if (res.ResultOk == "true")
            {
                //Session["session_memberID"] = res.memberID;
                //Session["session_restaurantID"] = res.restaurantID;
                //MSG("Success");
                //Response.Redirect("~/Restaurant/MemberDetail.aspx?memberID=" + res.ReturnMessage);
                Response.Redirect("~/memberLogin.aspx", true);
            }
            else
            {
                MSG(res.ErroMessage);
            }
        }