protected void btnWithdrawRequest_Click(object sender, EventArgs e)
    {
        var latestUserPH = _orderBll.GetLatestUserPh(UserId);

        if (latestUserPH == null)
        {
            DisplayMessage.ShowMessage("ban chua co lenh PH nao het", Page);
            return;
        }

        var lastOrderCode = _orderBll.GetByOrderCode(latestUserPH.LastOrderCode);

        if (latestUserPH.Status == 0 && lastOrderCode.Status == 2)
        {
            DisplayMessage.ShowMessage("lenh ph 20% moi dang cho dc nhan", Page);
        }
        else if (latestUserPH.Status == 1 && lastOrderCode.Status == 2)
        {
            AddNewOrder("Ask");
            lblMessageContent.Text = "Your GH request have been sent successfully.";
            DisplayMessage.ShowAlertModal("ShowAlertSuccess()", Page);
            LoadAllUserOrders();
        }
        else
        {
            DisplayMessage.ShowMessage("ban chua the rut vui long doc ky huong dan", Page);
        }
    }
    protected void btnCompletePayment_Click(object sender, EventArgs e)
    {
        var orderDetail = _orderDetailBll.GetOrderDetailByOrderDetailCode(hfOrderDetailCode.Value);

        if (orderDetail == null)
        {
            return;
        }

        orderDetail.OrderDetailCode = hfOrderDetailCode.Value;
        orderDetail.Status          = 1;
        if (!fuPhotoConfirmation.HasFiles)
        {
            DisplayMessage.ShowMessage("Please select a photo to confirm before complete this payment !", Page);
        }
        else
        {
            var fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + fuPhotoConfirmation.FileName;
            fuPhotoConfirmation.SaveAs(Path.Combine(Server.MapPath("~/Member/Upload/PhConfirm"), fileName));
            orderDetail.Confirmation = fileName;
            _orderDetailBll.UpdateOrderDetail(orderDetail);

            lblMessageContent.Text = "You have been completed successfully.";
            DisplayMessage.ShowAlertModal("ShowAlertSuccess()", Page);
        }

        LoadAllUserOrders();
        LoadAllUserOrderDetail();
    }
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     if (_adminUserBll.CheckAdminUserLogin(txtUserName.Text, MD5Password.MD5Hash(txtPassword.Text)))
     {
         var userAdmin = _adminUserBll.GetAdminUserByUsername(txtUserName.Text);
         BitcoinSession.AdminUser = userAdmin.Id;
         Response.Redirect("Default.aspx");
     }
     else
     {
         DisplayMessage.ShowMessage("You can not login !", Page);
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (_adminUserBll.CheckUserNameExists(txtUserName.Text))
     {
         DisplayMessage.ShowMessage("Username already registered, please choose a another username !", Page);
         return;
     }
     else if (_adminUserBll.CheckEmailExists(txtEmail.Text))
     {
         DisplayMessage.ShowMessage("Email already registered, please choose a another email !", Page);
         return;
     }
     else
     {
         AddNewAdminUser();
         ClearControls.ClearControl(this);
         DisplayMessage.ShowMessage("Inserted successfully !", Page);
     }
 }
Beispiel #5
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        var adminUser = _adminUserBll.GetAdminUserById(Convert.ToInt32(Request.QueryString["id"]));

        if (adminUser == null)
        {
            throw new ArgumentNullException("adminUser");
        }
        else
        {
            adminUser.Password = txtPassword.Text != adminUser.Password ? MD5Password.MD5Hash(txtPassword.Text) : adminUser.Password;
            adminUser.Email    = txtEmail.Text;
            adminUser.FullName = txtFullName.Text;
            adminUser.Active   = chkbActive.Checked;

            _adminUserBll.UpdateAdminUser(adminUser);
            DisplayMessage.ShowMessage("Updated successfully !", Page);
        }
    }
    private void ChangePassword()
    {
        var id = BitcoinSession.AdminUser;

        if (id != 0)
        {
            var adminUser = _adminUserBll.GetAdminUserById(id);
            if (adminUser == null)
            {
                throw new ArgumentNullException("adminUser");
            }
            if (adminUser.Password != MD5Password.MD5Hash(txtCurrentPassword.Text))
            {
                DisplayMessage.ShowMessage("Your current password is not valid !", Page);
            }
            else
            {
                adminUser.Password = MD5Password.MD5Hash(txtNewPassword.Text);
                _adminUserBll.UpdateAdminUser(adminUser);
                ClearControls.ClearControl(this);
                DisplayMessage.ShowMessage("You have been changed password successfully !", Page);
            }
        }
    }