Exemple #1
0
        protected void BayiEditPopup_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
        {
            var  roleGuid = e.Parameter.ToString();
            Guid guid     = new Guid(roleGuid);
            var  list2    = db.S_MenuYetkileri(3, guid).ToList();

            if (list2.Count > 0)
            {
                ASPxTreeList1.DataSource = list2;
            }
            else
            {
                ASPxTreeList1.DataSource = null;
            }

            ASPxTreeList1.DataBind();
            ASPxTreeList1.SettingsSelection.Recursive = true;
            ASPxTreeList1.ExpandToLevel(2);

            foreach (var item in list2.ToList())
            {
                if ((bool)item.Checkbox)
                {
                    ASPxTreeList1.FindNodeByFieldValue("ID", item.ID).Selected = true;
                }
                else
                {
                    ASPxTreeList1.FindNodeByFieldValue("ID", item.ID).Selected = false;
                }
            }

            RoleEditPopup.JSProperties["cpEmployeeID"] = roleGuid;
            RoleEditPopup.JSProperties["cpHeaderText"] = string.Format("Role Düzenle, ({0} {1})", "Guid", roleGuid);
        }
Exemple #2
0
 protected void PopupControlUsers_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     RemoveSession(Enums.CommonSession.UserActionPopUp);
     RemoveSession(Enums.EmployeeSession.EmployeeID);
     RemoveSession(Enums.EmployeeSession.UserID);
     RemoveSession(Enums.EmployeeSession.UserModel);
 }
Exemple #3
0
 protected void PopupDoiMatKhau_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     try
     {
         //Xu ly callback popup doi mat khau
         String strerror = "";
         String result   = CustomValidate.checkControlEmpty(pnPopupChangePassword, new String[] { "txtMatKhauCu", "txtMatKhauMoi", "txtXacNhanMatKhauMoi" });
         if (result != null)
         {
             PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE;
             PopupDoiMatKhau.JSProperties["cpMess"]         = result;
             return;
         }
         HttpCookie cookie = Request.Cookies[Constant.USER_COOKIE];
         if (cookie == null)
         {
             Response.Redirect("~/Login/Login.aspx");
         }
         UsersDH ctlUser = new UsersDH();
         String  UserLog = Utils.Decrypt(cookie[Constant.NAME_COOKIE]);
         User    objUser = ctlUser.validateLogin(UserLog, Utils.Encrypt(txtMatKhauCu.Text));
         if (objUser == null)
         {
             PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE;
             PopupDoiMatKhau.JSProperties["cpMess"]         = "Mật khẩu cũ bạn nhập không chính xác.";
             return;
         }
         if (!txtMatKhauMoi.Text.Equals(txtXacNhanMatKhauMoi.Text))
         {
             PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE;
             PopupDoiMatKhau.JSProperties["cpMess"]         = "Xác nhận mật khẩu không chính xác.";
             return;
         }
         ctlUser.updateUserPassword(UserLog, Utils.Encrypt(txtMatKhauMoi.Text));
         PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_SUCCESS;
         PopupDoiMatKhau.JSProperties["cpMess"]         = String.Format("Cập nhập mật khẩu cho tài khoản [{0}] thành công.", UserLog);
         return;
     }
     catch (Exception ex)
     {
         PopupDoiMatKhau.JSProperties["cpUpdateStatus"] = Constant.NOTIFY_FAILURE;
         PopupDoiMatKhau.JSProperties["cpMess"]         = ex.Message + " " + ex.StackTrace;
     }
 }
Exemple #4
0
 protected void PopupControlMeasuringUnit_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     RemoveSession(Enums.CommonSession.UserActionPopUpInPopUp);
     RemoveSession(Enums.MeasuringUnitSession.MeasuringUnitID);
     RemoveSession(Enums.MeasuringUnitSession.MeasuringUnitModel);
 }
Exemple #5
0
 protected void PopupControlCategorie_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     RemoveSession(Enums.CommonSession.UserActionPopUpInPopUp);
     RemoveSession(Enums.CategorieSession.CategorieID);
     RemoveSession(Enums.CategorieSession.CategorieModel);
 }
Exemple #6
0
 protected void PopupControlSupplier_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     RemoveSession(Enums.CommonSession.UserActionPopUpInPopUp);
     RemoveSession(Enums.SupplierSession.ClientID);
     RemoveSession(Enums.SupplierSession.ClientModel);
 }
 protected void PopupControlSearchInventory_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     RemoveSession(Enums.IssueDocumentSession.SearchUIDValue);
 }
 protected void ASPxPopupControl1_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
 {
     ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "RefreshPage", "RefreshPage();", true);
 }