public static void GetAll(Model_Users parameters)
    {
        IList <Model_Users> ret = UsersController.GetUsers_Paging(parameters);


        AppTools.SendResponse(HttpContext.Current.Response, ret.ObjectToJSON());
    }
Example #2
0
    public static void SendEmailSuccess(int UserID)
    {
        Model_Setting s = new Model_Setting();

        s = s.GetSetting();

        Model_Users user = GetUserbyID(UserID);

        string body = string.Empty;
        string text = File.ReadAllText(HttpContext.Current.Server.MapPath("/Theme/emailtemplate/layout_sgSuccess.html"), Encoding.UTF8);

        if (!string.IsNullOrEmpty(text))
        {
            //string path = ConfigurationManager.AppSettings["AuthorizeBaseURL"].ToString().Replace("/admin", "") + "Verify?ID=" + StringUtility.EncryptedData(user.UserID.ToString());
            //body = text.Replace("<!--##@Linkverfiy##-->", path);
            //body = text.Replace("<!--##@Linkverfiy_btn##-->", path);

            body = text;
        }

        MailSenderOption option = new MailSenderOption
        {
            MailSetting = s,
            context     = HttpContext.Current,
            mailTo      = user.Email,
            Mailbody    = body,
            Subject     = "การสมัครของคุณเสร็จสิ้น/ You've successfully Register to Keen Profile System"
        };

        MAilSender.SendMailEngine(option);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Login";
        if (!this.Page.IsPostBack)
        {
            Model_Users u = UserSessionController.FrontAppAuthLogin(this);
            //if (u != null)
            //{
            //    Response.Redirect("/");
            //    Response.End();
            //}


            //string YearSel = string.Empty;
            //for(int i = 0; i < 60; i++)
            //{
            //    int yearstart = 1958;
            //    yearstart = yearstart + i;

            //    YearSel += "<option value=\""+ yearstart + "\" data-content=\""+ yearstart + "\" >"+ yearstart + "</option>";

            //}

            //yearlist.Text = YearSel;
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            //dropRole.DataSource = UsersController.GetUserRole();
            //dropRole.DataTextField = "Title";
            //dropRole.DataValueField = "UsersRoleId";
            //dropRole.DataBind();

            //ListItem lis = new ListItem("All", "0");
            //dropRole.Items.Insert(0, lis);

            if (!string.IsNullOrEmpty(Request.QueryString["s"]))
            {
                Model_Users mu = UsersController.GetUserbyID(int.Parse(Request.QueryString["s"]));

                if (mu != null)
                {
                    FirsName.Text = mu.FirstName;
                    LastName.Text = mu.LastName;
                    UserName.Text = mu.UserName;
                }
            }
        }
    }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         Model_Users u = UserSessionController.AdminAppAuthLogin(this);
     }
 }
    protected override void OnLoad(EventArgs e)
    {
        // StaffSessionAuthorize.CheckCooikie();
        Model_Users u = UserSessionController.FrontAppAuthorization(this);



        if (u != null)
        {
            this.UserActive = u;
            if (!u.EmailVerify)
            {
                Page.Master.FindControl("alertbar").Visible = true;
                LinkButton l = (LinkButton)Page.Master.FindControl("sendmailverify");
                l.CommandArgument = u.UserID.ToString();

                if (!string.IsNullOrEmpty(Request.QueryString["resend"]))
                {
                    Page.Master.FindControl("alertbarsentmailcompleted").Visible = true;
                    //Page.Master.FindControl("alertbar").Visible = false;
                }
                else
                {
                    Page.Master.FindControl("alertbarsentmailcompleted").Visible = false;
                }
            }
            //Page.ClientScript.RegisterClientScriptBlock(GetType(), "alertVerify", "alertshow();", true);
        }

        base.OnLoad(e);
    }
    public int InsertUserToSesstionRecord(Model_Users ms)
    {
        using (SqlConnection cn = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand(@"INSERT INTO UserSession (UserID,LastAccessUrl,IPAddress,TimeAccess,LastAccess,Browser,Lang_Id)VALUES(@UserID,@LastAccessUrl,@IPAddress,@TimeAccess,@LastAccess,@Browser,@Lang_Id);SET @UserSessionID = scope_identity()", cn);
            cmd.Parameters.Add("@UserID", SqlDbType.Int).Value             = ms.UserID;
            cmd.Parameters.Add("@LastAccessUrl", SqlDbType.NVarChar).Value = this.CurrentURL;

            if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
            {
                cmd.Parameters.Add("@IPAddress", SqlDbType.VarChar).Value = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
            }
            else
            {
                cmd.Parameters.Add("@IPAddress", SqlDbType.VarChar).Value = HttpContext.Current.Request.UserHostAddress;
            }
            cmd.Parameters.Add("@TimeAccess", SqlDbType.DateTime).Value   = DatetimeHelper._UTCNow();
            cmd.Parameters.Add("@LastAccess", SqlDbType.DateTime).Value   = DatetimeHelper._UTCNow();
            cmd.Parameters.Add("@Browser", SqlDbType.NVarChar).Value      = HttpContext.Current.Request.Browser.Browser.ToString();
            cmd.Parameters.Add("@Lang_Id", SqlDbType.TinyInt).Value       = 1;
            cmd.Parameters.Add("@UserSessionID", SqlDbType.Int).Direction = ParameterDirection.Output;

            cn.Open();

            int ret = ExecuteNonQuery(cmd);
            //HttpContext.Current.Response.Write((int)cmd.Parameters["@SessionId"].Value);
            //HttpContext.Current.Response.End();
            return((int)cmd.Parameters["@UserSessionID"].Value);
        }
    }
Example #8
0
    public static Model_Users AdminAppAuthLogin(Page p)
    {
        Model_Users u = null;



        if (HttpContext.Current.Request.Cookies["SessionKey"] != null)
        {
            HttpCookie objCookie = new HttpCookie("SessionKey");
            //objCookie.Domain = "www.hotels2thailand.com";
            objCookie.Expires = DateTime.Now.AddDays(-1d);
            HttpContext.Current.Response.Cookies.Add(objCookie);


            Model_Session ms        = new Model_Session();
            int           intLogKey = int.Parse(HttpContext.Current.Request.Cookies["SessionKey"]["LogKey"]);
            ms = ms.IsHaveSessionRecord(intLogKey);
            if (ms != null)
            {
                u = UsersController.GetUserbyID(ms.UserID);
                if (u != null && !ms.LeaveTime.HasValue)
                {
                    HttpContext.Current.Response.Redirect("~/admin/");
                }
            }
        }



        return(u);
    }
Example #9
0
    public static int InsertUserExternal(Model_Users user)
    {
        int ret = user.InsertUserExternal(user);


        return(ret);
    }
Example #10
0
    protected void CreateUser_ClickAsync(object sender, EventArgs e)
    {
        Model_Users u = new Model_Users
        {
            FirstName   = FirsName.Text,
            LastName    = LastName.Text,
            UserCatId   = 2,
            UsersRoleId = byte.Parse(dropRole.SelectedValue),
            Password    = Password.Text,
            UserName    = UserName.Text
        };

        int ret = UsersController.InsertUserAdmin(u);

        if (ret < 0)
        {
            lblsms.Text = "username and password is used already ";
        }
        //var manager = new UserManager();
        //var user = new ApplicationUser()
        //{
        //    FirstName = FirsName.Text,
        //    LastName = LastName.Text,
        //    Email = Email.Text,
        //    UserName = UserName.Text,
        //    UserCatId = 2,
        //    UsersRoleId = byte.Parse(dropRole.SelectedValue)

        //};
        //// Configure validation logic for usernames
        //manager.UserValidator =
        //    new UserValidator<ApplicationUser>(manager)
        //    {
        //        AllowOnlyAlphanumericUserNames = false,
        //        RequireUniqueEmail = true
        //    };

        //// Configure validation logic for passwords
        ////manager.PasswordValidator = new MinimumLengthValidator(4);
        //manager.PasswordValidator = new PasswordValidator
        //{
        //    RequiredLength = 3,
        //    //RequireNonLetterOrDigit = true,
        //    RequireDigit = true,
        //    RequireLowercase = true,
        //    RequireUppercase = true,
        //};
        //IdentityResult result = await manager.CreateAsync(user, Password.Text);
        //if (result.Succeeded)
        //{
        //    IdentityHelper.SignIn(manager, user, isPersistent: false);
        //    IdentityHelper.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
        //}
        //else
        //{
        //    ErrorMessage.Text = result.Errors.FirstOrDefault();
        //}
    }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page        p = new Page();
        Model_Users u = UserSessionController.FrontAppAuthorization(p);

        if (u != null)
        {
            lblprofile.Text = "<i class=\"fa fa-user\" aria-hidden=\"true\"></i> " + u.FirstName + " |&nbsp; <a style=\"color:#fff;\" href=\"http://member.keenprofile.com/logout\" />Log out <i class=\"fa fa-sign-out\" aria-hidden=\"true\"></i></a>";
        }
    }
Example #12
0
    public static int InsertUser(Model_Users user)
    {
        int ret = user.InsertUser(user);

        if (ret > 0)
        {
            SendEmailVerify(ret);
        }
        return(ret);
    }
Example #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Order";
        if (!this.Page.IsPostBack)
        {
            //if (!string.IsNullOrEmpty(Request.QueryString["success"]))
            //{
            //    main_thanks.Visible = true;
            //    main_form.Visible = false;

            //    Model_AssesIntro intro = new Model_AssesIntro();
            //    intro = intro.GetIntro();
            //    ThanksTitle.Text = intro.ThanksTitle;
            //    ThanksDes.Text = convertcontent(intro.ThanksDes);
            //}

            if (!string.IsNullOrEmpty(Request.QueryString["ProductID"]))
            {
                switch (Request.QueryString["ProductID"])
                {
                case "1":
                    lbltitle.Text     = "ลิสต์รายชื่อสายงานทั้งหมดที่เหมาะกับอัจฉริยภาพและบุคลิกการทำงานของคุณ ง่ายๆ";
                    lbltitle2.Text    = "แค่ดาวน์โหลด \"The Right Job - Functions Report\"";
                    lblpricemock.Text = "1,000";
                    lblpricenet.Text  = "100";

                    amount.Text = "100";

                    Maintitle.Text = "The Right Job-Functions Report";
                    break;

                case "2":
                    lbltitle.Text     = "โค้ชลงลึกเกี่ยวกับกลยุทธ์เส้นทางอาชีพของคุณในอีก 3-5 ปีข้างหน้า โดยทีมงานผู้เชี่ยวชาญที่สัมภาษณ์ผู้บริหารมาแล้วมากกว่าพันคน คุณจะไม่ต้องหลงทางกับเส้นทางอาชีพของคุณอีกต่อไป";
                    lbltitle2.Text    = "";
                    lblpricemock.Text = "5,000";
                    lblpricenet.Text  = "1,000";
                    amount.Text       = "1,000";

                    Maintitle.Text = "KEENCareer Coaching";
                    break;
                }
            }

            Model_Users u = this.UserActive;

            string orderID = Request.QueryString["orderID"];
            if (u != null && !string.IsNullOrEmpty(orderID))
            {
                firstName.Text = u.FirstName;
                email.Text     = u.Email;

                txtPhone.Text = u.MobileNumber;
            }
        }
    }
Example #14
0
        public UserDTO Login(string login, string password)
        {
            string hash = Model_Users.GetHash(SHA256.Create(), password);

            if (model_Users.Users.Any(el => el.Login == login && el.PasswordHash == hash))
            {
                UserDTO userDTO = mapperTo.Map <UserDTO>(model_Users.Users.FirstOrDefault(el => el.Login == login && el.PasswordHash == hash));
                return(userDTO);
            }
            return(null);
        }
Example #15
0
    public static int ConfirmTransferPayment(int OrderID, Model_Users u, Model_OrderPaymentTransferConfirm con, int intProductID)
    {
        int ret = 0;

        try {
            Model_OrderPayment        payment     = new Model_OrderPayment();
            List <Model_OrderPayment> listpayment = payment.getPaymentByOrderID(con.OrderID);
            if (listpayment.Count > 0)
            {
                var total = listpayment.Sum(o => o.Amount);

                var PaymentID = listpayment.FirstOrDefault().PaymentID;


                if (con.Amount >= total)
                {
                    con.PaymentID = PaymentID;

                    if (con.InsertOrderPaymentTransferConfirm(con) > 0)
                    {
                        payment.UpdatePayment(PaymentID);

                        //Update user to Paid;
                        u.Ispaid = true;
                        UsersController.UpdateIsPaidUser(u);

                        Model_Setting s = new Model_Setting();
                        s = s.GetSetting();



                        HttpContext context = HttpContext.Current;

                        object[] parameters = new object[] { u, s, context, intProductID };
                        SendingEngineController.cpool.QueueWork(parameters, SendEmaiReceiveToCustomer);

                        string   staffEmail  = "[email protected];[email protected];[email protected]";
                        object[] parameters2 = new object[] { staffEmail, s, context, con, intProductID };

                        SendingEngineController.cpool.QueueWork(parameters2, SendEmailReceiveToStaff);
                    }
                }
            }



            ret = 1;
        } catch
        {
        }

        return(ret);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Page.Title = "KeenProfile Login";
     if (!this.Page.IsPostBack)
     {
         Model_Users u = UserSessionController.FrontAppAuthLogin(this);
         //if (u != null)
         //{
         //    Response.Redirect("/");
         //    Response.End();
         //}
     }
 }
    protected void btn_login_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Request.QueryString["e"]))
        {
            HttpSessionState Hotels2Session = HttpContext.Current.Session;
            string           password       = signup_password.Text.Trim();
            string           q        = StringUtility.DecryptedData(Request.QueryString["e"]);
            string[]         arrq     = q.Split('@');
            string           qUserID  = arrq[0];
            string           qSession = arrq[1];

            if (Hotels2Session[qSession] == null)
            {
                ss.InnerHtml            = "Sorry the session is timeout";
                signup_password.Visible = false;
                ConfirmPassword.Visible = false;
                btn_login.Visible       = false;
                bb.Visible         = false;
                btn_forgot.Visible = true;
            }
            else
            {
                Model_Users mu = new Model_Users
                {
                    UserID   = int.Parse(qUserID),
                    Password = password
                };

                if (UsersController.UpdatePassword(mu))
                {
                    signup_password.Visible = false;
                    ConfirmPassword.Visible = false;
                    btn_login.Visible       = false;
                    bb.Visible        = false;
                    ss.InnerHtml      = "New password set successfully.";
                    btn_login.Visible = false;

                    btnBacklogin.Visible = true;
                }
            }
        }
        else
        {
            ss.InnerHtml            = "Sorry the session is timeout";
            signup_password.Visible = false;
            ConfirmPassword.Visible = false;
            btn_login.Visible       = false;
            bb.Visible         = false;
            btn_forgot.Visible = true;
        }
    }
Example #18
0
    public static int MakeOrder(int intProductId, Model_Users u)
    {
        int ret = 0;

        try
        {
            Model_Orders o = new Model_Orders
            {
                Status   = true,
                StatusID = 1,
                UserID   = u.UserID
            };

            int orderID = o.InsertOrder(o);

            if (orderID > 0)
            {
                Model_Products Cproduct = new Model_Products();
                Cproduct = Cproduct.getProductByID(intProductId);

                Model_OrderProducts p = new Model_OrderProducts
                {
                    OrderID   = orderID,
                    ProductID = intProductId,
                    Title     = Cproduct.Title,
                    Detail    = Cproduct.Detail,
                    Price     = Cproduct.Price
                };
                p.InsertOrderProduct(p);

                Model_OrderPayment cp = new Model_OrderPayment
                {
                    OrderID       = orderID,
                    Amount        = Cproduct.Price,
                    GateWayID     = (byte)GateWayBank.Kbank,
                    PaymentTypeID = (byte)PaymentType.Transfer
                };
                cp.InsertOrderPayment(cp);
            }



            ret = orderID;
        }
        catch
        {
        }


        return(ret);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         Model_Users u = UserSessionController.AdminAppAuthLogin(this);
     }
     //RegisterHyperLink.NavigateUrl = "Register";
     //OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];
     //var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
     //if (!String.IsNullOrEmpty(returnUrl))
     //{
     //    RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
     //}
 }
Example #20
0
    public static bool UpDateVerify(int intUserID)
    {
        Model_Users mu = new Model_Users
        {
            UserID = intUserID
        };

        if (mu.UpdateUserVerify(mu))
        {
            SendEmailSuccess(intUserID);
        }

        return(true);
    }
Example #21
0
 public bool Register(string login, string email, string password)
 {
     if (!model_Users.Users.Any(el => el.Login == login))
     {
         User user = new User()
         {
             Login = login, Email = email, PasswordHash = Model_Users.GetHash(SHA256.Create(), password)
         };
         model_Users.Users.Add(user);
         model_Users.SaveChanges();
         return(true);
     }
     return(false);
 }
Example #22
0
    protected void btn_confirm_Click(object sender, EventArgs e)
    {
        Model_Users u = this.UserActive;

        string orderID = Request.QueryString["orderID"];

        int    intOrderID = int.Parse(orderID);
        string Filename   = orderID + ".jpg";

        DirectoryInfo fdr = new DirectoryInfo(Server.MapPath("/orderconfirmfile/"));

        if (!fdr.Exists)
        {
            fdr.Create();
        }

        string FilePath = "/orderconfirmfile/" + Filename;

        string DAteconfirm = hd_date_payment.Value;

        string[] arrdatetime = DAteconfirm.Split('-');
        DateTime dpay        = new DateTime(int.Parse(arrdatetime[0]), int.Parse(arrdatetime[1]), int.Parse(arrdatetime[2]), int.Parse(arrdatetime[3]), int.Parse(arrdatetime[4]), int.Parse(arrdatetime[5])).ToUniversalTime();
        Model_OrderPaymentTransferConfirm con = new Model_OrderPaymentTransferConfirm
        {
            Name        = firstName.Text.Trim(),
            Email       = email.Text.Trim(),
            DatePayment = dpay,
            Amount      = decimal.Parse(amount.Text),
            Phone       = txtPhone.Text,
            Extra       = txtextra.Text,
            FilePath    = FilePath,
            OrderID     = intOrderID,
            GateWayID   = byte.Parse(dropgatway.SelectedValue),
            BankIssue   = functionBakIssue(byte.Parse(dropgatway.SelectedValue))
        };
        int intProductID = int.Parse(Request.QueryString["ProductID"]);

        int ret = OrderController.ConfirmTransferPayment(intOrderID, u, con, intProductID);

        if (ret > 0)
        {
            if (file.HasFile)
            {
                file.PostedFile.SaveAs(HttpContext.Current.Server.MapPath(FilePath));
            }

            Response.Redirect("~/Thankyou?Con=firm&OrderID=" + orderID + "&ProductID=" + intProductID);
        }
    }
    protected override void OnLoad(EventArgs e)
    {
        // StaffSessionAuthorize.CheckCooikie();
        Model_MainSetting s = new Model_MainSetting();

        this.MainSetting = s.GetMainSetting();
        Model_Users u = UserSessionController.AdminAppAuthorization(this);

        if (u != null)
        {
            this.UserActive = u;
        }

        base.OnLoad(e);
    }
Example #24
0
    public static void SessionCreateUserFront(Model_Users Users)
    {
        HttpSessionState Hotels2Session = HttpContext.Current.Session;

        Hotels2Session["UserFront"] = Users.UserCatId;

        Model_Session ms = new Model_Session();

        int Key = ms.InsertUserToSesstionRecord(Users);

        //creat Cookie for Reference user Login Life Time
        CreateCookieSessionFront(Key);

        HttpContext.Current.Response.Redirect("~/");
    }
Example #25
0
    public static Model_Users SendEmailForgot(string email)
    {
        Model_Setting s = new Model_Setting();

        s = s.GetSetting();
        Model_Users user = GetUserbyEmailFront(email);


        if (user != null)
        {
            string body = string.Empty;
            string text = File.ReadAllText(HttpContext.Current.Server.MapPath("/Theme/emailtemplate/layoutforgot.html"), Encoding.UTF8);
            if (!string.IsNullOrEmpty(text))
            {
                string param       = user.UserID.ToString();
                string time        = DateTime.Now.ApiService_DateToTimestamp();
                string paramstring = param + "@" + time;

                HttpSessionState Hotels2Session = HttpContext.Current.Session;

                Hotels2Session.Clear();

                Hotels2Session.Timeout = 10;
                Hotels2Session[time]   = time;



                string path = ConfigurationManager.AppSettings["AuthorizeBaseURL"].ToString().Replace("/admin", "") + "ResetPassword?e=" + StringUtility.EncryptedData(paramstring);
                body = text.Replace("<!--##@Linkresetpassword##-->", path);
            }

            MailSenderOption option = new MailSenderOption
            {
                MailSetting = s,
                context     = HttpContext.Current,
                mailTo      = user.Email,
                Mailbody    = body,
                Subject     = "Forgot password and reset password"
            };
            MAilSender.SendMailEngine(option);
        }


        return(user);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Reset Password";
        if (!this.Page.IsPostBack)
        {
            Model_Users u = UserSessionController.FrontAppAuthLogin(this);
            if (u != null)
            {
                Response.Redirect("/");
                Response.End();
            }
            else
            {
                if (!string.IsNullOrEmpty(Request.QueryString["e"]))
                {
                    HttpSessionState Hotels2Session = HttpContext.Current.Session;

                    string   q        = StringUtility.DecryptedData(Request.QueryString["e"]);
                    string[] arrq     = q.Split('@');
                    string   qUserID  = arrq[0];
                    string   qSession = arrq[1];

                    if (Hotels2Session[qSession] == null)
                    {
                        ss.InnerHtml            = "Sorry the session is timeout";
                        signup_password.Visible = false;
                        ConfirmPassword.Visible = false;
                        btn_login.Visible       = false;
                        bb.Visible         = false;
                        btn_forgot.Visible = true;
                    }
                }
                else
                {
                    ss.InnerHtml            = "Sorry the session is timeout";
                    signup_password.Visible = false;
                    ConfirmPassword.Visible = false;
                    btn_login.Visible       = false;
                    bb.Visible         = false;
                    btn_forgot.Visible = true;
                }
            }
        }
    }
    protected void btn_login_Click(object sender, EventArgs e)
    {
        Model_Users u = UsersController.UserChecklogin(email_txt.Value.Trim(), password_txt.Value.Trim());

        if (u != null)
        {
            UserSessionController.CloseOtherCurrentLogin(u.UserID);
            UserSessionController.SessionCreateUserFront(u);
        }
        else
        {
            Model_Users ux = UsersController.UserCheckloginExternal(email_txt.Value.Trim());
            if (ux != null)
            {
                string url = Request.Url.ToString().Split('?')[0];

                switch (ux.UserLoginChannel)
                {
                case UserLoginChannel.Application:

                    Response.Redirect(url + "?loginfailed=passwordinvalid");
                    break;

                case UserLoginChannel.Facebook:
                    Response.Redirect(url + "?loginfailed=sociallogin&s=facebook");
                    break;

                case UserLoginChannel.Google:
                    Response.Redirect(url + "?loginfailed=sociallogin&s=google");
                    break;

                case UserLoginChannel.LinkedIn:
                    Response.Redirect(url + "?loginfailed=sociallogin&s=linkedin");
                    break;
                }
            }
            else
            {
            }
            //FailureText.Text = "UserName Invalid";
            //ErrorMessage.Visible = true;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        bool        bolIsreset = (resetPassword.Visible ? true : false);
        Model_Users user       = new Model_Users
        {
            IsResetPassword = bolIsreset,
            FirstName       = FirsName.Text,
            UserName        = UserName.Text,
            LastName        = LastName.Text,
            Password        = Password.Text,
            UsersRoleId     = byte.Parse(dropRole.SelectedValue),
            UserID          = int.Parse(Request.QueryString["s"])
        };

        if (UsersController.UpdateUserAdmin(user))
        {
            Response.Redirect(Request.Url.ToString());
        }
    }
Example #29
0
    public static void SendEmaiReceiveToCustomer(object param)
    {
        object[] parameters = (object[])param;


        Model_Users   user    = (Model_Users)parameters[0];
        Model_Setting s       = (Model_Setting)parameters[1];
        HttpContext   context = (HttpContext)parameters[2];

        int intProductID = (int)parameters[3];


        string body = string.Empty;
        string text = string.Empty;

        if (intProductID == 1)
        {
            text = File.ReadAllText(context.Server.MapPath("/Theme/emailtemplate/layout_r3.html"), Encoding.UTF8);
        }

        if (intProductID == 2)
        {
            text = File.ReadAllText(context.Server.MapPath("/Theme/emailtemplate/layout_coaching.html"), Encoding.UTF8);
        }
        //if (!string.IsNullOrEmpty(text))
        //{
        //    string path = ConfigurationManager.AppSettings["AuthorizeBaseURL"].ToString().Replace("/admin", "") + "Verify?ID=" + StringUtility.EncryptedData(user.UserID.ToString());
        //    body = text.Replace("<!--##@Linkverfiy##-->", "<a href=\"" + path + "\" />here</a>");
        //}
        body = text;
        MailSenderOption option = new MailSenderOption
        {
            MailSetting = s,
            context     = HttpContext.Current,
            mailTo      = user.Email,
            Mailbody    = body,
            Subject     = "การชำระค่าบริการเสร็จสมบูรณ์แล้ว / Success Payment Confirmation"
        };

        MAilSender.SendMailEngine(option);
    }
Example #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Thank you";
        if (!this.Page.IsPostBack)
        {
            //if (!string.IsNullOrEmpty(Request.QueryString["success"]))
            //{
            //    main_thanks.Visible = true;
            //    main_form.Visible = false;

            //    Model_AssesIntro intro = new Model_AssesIntro();
            //    intro = intro.GetIntro();
            //    ThanksTitle.Text = intro.ThanksTitle;
            //    ThanksDes.Text = convertcontent(intro.ThanksDes);
            //}

            Model_Users u = this.UserActive;

            string orderID = Request.QueryString["orderID"];



            if (u != null && !string.IsNullOrEmpty(orderID))
            {
                switch (Request.QueryString["ProductID"])
                {
                case "1":
                    lbldes.Text = "เราได้รับการยืนยันการโอนเงินจากคุณเรียบร้อยแล้ว <strong> กรุณารอการยืนยันจากทีมงานประมาณ 5 นาที </strong> ทางทีมงานจะส่งอีเมลแจ้งคุณทันทีที่การโอนเงินได้รับการยืนยันจากเจ้าหน้าที่ จากนั้นคุณจะสามารถ Download Report ได้ทันที โดยปุ่มจะเปลี่ยนจาก \"ต้องการ Download\" เป็น \"คลิกเพื่อ Download\"";
                    break;

                case "2":
                    lbldes.Text = "เราได้รับการยืนยันการโอนเงินจากคุณเรียบร้อยแล้ว <strong>กรุณารอการยืนยันจากทีมงานประมาณ 1-3 วัน </strong> ทางทีมงานจะส่งอีเมลและโทรติดต่อคุณทันทีที่การโอนเงินได้รับการยืนยันจากเจ้าหน้าที่ จากนั้นทีมผู้เชี่ยวชาญจะทำการนัดหมายคุณเพื่อรับการโค้ชในวัน-เวลาที่คุณสะดวก";
                    break;
                }


                Maintitle.Text = "Order Summary : OrderID#158237 [รอการชำระเงิน]";
            }
        }
    }