Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AllGLAccounts, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                ASPxTreeList1.DataBind();
                TreeListNode firstUnread = ASPxTreeList1.FindNodeByFieldValue("IsNew", true);
                //  firstUnread.Focus();
                ASPxTreeList1.ExpandToLevel(2);
            }
            GLAccount gl = new GLAccount();
            DataTable dt = gl.getList();

            ASPxTreeList1.DataSource = dt;
            ASPxTreeList1.DataBind();
            AddSubmitEvent();
            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "success")
                {
                    Response.Write("<script>alert('تم الحفظ بنجاح.');</script>");
                }
            }
        }
Exemple #2
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);
        }