public void TestPermission()
        {
            try
            {
                getCookies _getCookies = new getCookies();
                _getCookies.getCookiesNew();

                int _idUser  = Utils.CIntDef(Session["Userid"], 0);
                int _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                if (_idGroup != 1 && _idGroup != 7)
                {
                    FileManager1.Visible        = true;
                    Panel_upload.Visible        = false;
                    Panel_deny.Visible          = false;
                    FileManager1.ReadOnly       = false;
                    FileManager1.AllowDelete    = false;//Cho phép Xóa
                    FileManager1.AllowOverwrite = true;
                }
                else
                {
                    FileManager1.Visible        = true;
                    Panel_upload.Visible        = false;
                    Panel_deny.Visible          = false;
                    FileManager1.ReadOnly       = false;
                    FileManager1.AllowDelete    = true;//Cho phép Xóa
                    FileManager1.AllowOverwrite = true;
                }
            }
            catch (Exception) { Response.Redirect("trang-chu.aspx"); }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            getCookies _getCookies = new getCookies();

            _getCookies.getCookiesNew();
            int _grouptype = Utils.CIntDef(Session["Grouptype"], 0);

            if (_grouptype != 1 && _grouptype != 2)
            {
                txtDaThu.Enabled = txtFromDate.Visible = false;
            }


            _id = Utils.CIntDef(Request.QueryString["id"]);
            idNameUser.Visible = false;
            ddlType.Enabled    = _id == 0 ? true : false;
            if (!IsPostBack)
            {
                Getinfo();
                //TestPermission();
                ddlType_SelectedIndexChanged(sender, e);
                LoadTypeReg(_id);
                CheckTypeReg(_id);
            }
            else
            {
                if (HttpContext.Current.Session["companies.listmenucha"] != null)
                {
                    ASPxTreeList_menu.DataSource = HttpContext.Current.Session["companies.listmenucha"];
                    ASPxTreeList_menu.DataBind();
                }
            }
        }
예제 #3
0
        public void TestPermission()
        {
            try
            {
                getCookies _getCookies = new getCookies();
                _getCookies.getCookiesNew();

                int _groupType = Utils.CIntDef(Session["Grouptype"]);
                if (_groupType != 1 && _groupType != 2 && _groupType != 3 && _groupType != 14)
                {
                    string strScript = "<script>";
                    strScript += "alert('Bạn không được cấp quyền truy cập trang này!');";
                    strScript += "window.location='trang-chu.aspx';";
                    strScript += "</script>";
                    Page.RegisterClientScriptBlock("strScript", strScript);
                }
                else
                {
                    if (_groupType == 3)
                    {
                        tEditText.Visible  = false;
                        lbtnSave.Visible   = false;
                        lbtnDelete.Visible = false;
                    }
                }
            }
            catch (Exception) { Response.Redirect("trang-chu.aspx"); }
        }
 public void TestPermission()
 {
     try
     {
         getCookies _getCookies = new getCookies();
         _getCookies.getCookiesNew();
     }
     catch (Exception) { Response.Redirect("trang-chu.aspx"); }
 }
        public void TestPermission()
        {
            try
            {
                getCookies _getCookies = new getCookies();
                _getCookies.getCookiesNew();

                if (Utils.CStrDef(Session["Grouptype"]) != "1" && Utils.CStrDef(Session["Grouptype"]) != "2")
                {
                    lbtnDelete.Visible = false;
                }
            }
            catch (Exception) { Response.Redirect("trang-chu.aspx"); }
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            getCookies _getCookies = new getCookies();

            _getCookies.getCookiesNew();
            TestPermission();

            if (!IsPostBack)
            {
                pickdate_Begin.returnDate = Convert.ToDateTime("01/01/2015");
                fromDate = pickdate_Begin.returnDate;
                pickdate_End.returnDate = DateTime.Now;
                toDate = pickdate_End.returnDate;
                _getCookies.getCookiesNew();//cấp lại session
                LoadProject();
            }
            else
            {
                ASPxGridView1_project.DataSource = HttpContext.Current.Session["listThanhLyHopDong"];
                ASPxGridView1_project.DataBind();
            }
        }
예제 #7
0
        public void TestPermission()
        {
            try
            {
                getCookies _getCookies = new getCookies();
                _getCookies.getCookiesNew();

                if (_id != 0)
                {
                    int _idUser  = Utils.CIntDef(Session["Userid"]);
                    int _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                    if (_idGroup != 1 && _idGroup != 2 && _idGroup != 7)
                    {
                        var obj = _MerHopDongDVData.GetById(_id);
                        if (obj != null)
                        {
                            if (Utils.CIntDef(obj.USER_ID) != _idUser)
                            {
                                Response.Redirect("danh-sach-hop-dong-ke-toan.aspx");
                            }
                            else
                            {
                                if (obj.MER_STATUS == 1)
                                {
                                    string strScript = "<script>";
                                    strScript += "alert(' Hợp đồng này đã được xử lý xong, bạn không có quyền chỉnh sửa!');";
                                    strScript += "window.location='danh-sach-hop-dong-ke-toan.aspx';";
                                    strScript += "</script>";
                                    Page.RegisterClientScriptBlock("strScript", strScript);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception) { Response.Redirect("danh-sach-hop-dong-ke-toan.aspx"); }
        }