Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string _action = MXRequest.GetQueryString("action");

            this.id = MXRequest.GetQueryInt("id");

            if (!string.IsNullOrEmpty(_action) && _action == MXEnums.ActionEnum.Edit.ToString())
            {
                this.action = MXEnums.ActionEnum.Edit.ToString();//修改类型
                if (this.id == 0)
                {
                    JscriptMsg("传输参数不正确!", "back", "Error");
                    return;
                }
                Model.manager adminEntity = GetAdminInfo();
                if (!rBll.Exists(this.id, adminEntity.id))
                {
                    JscriptMsg("角色不存在或已被删除!", "back", "Error");
                    return;
                }
            }
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("manager_role", MXEnums.ActionEnum.View.ToString()); //检查权限
                // RoleTypeBind(); //绑定角色类型
                NavBind();                                                         //绑定导航
                if (action == MXEnums.ActionEnum.Edit.ToString())                  //修改
                {
                    ShowInfo(this.id);
                }
            }
        }
Ejemplo n.º 2
0
        public bool ChkAuthority(string nav_name, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (result)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 检查管理员权限
 /// </summary>
 /// <param name="channel_name">栏目名称</param>
 /// <param name="action_type">操作类型</param>
 public void ChkAdminLevel(string channel_name, string action_type)
 {
     Model.manager model = GetAdminInfo();
     BLL.manager_role bll = new BLL.manager_role();
     bool result = bll.Exists(model.role_id, channel_name, action_type);
     if (!result)
     {
         string msbox = "parent.f_errorTab(\"错误提示\", \"您没有管理该页面的权限,请勿尝试非法进入!\")";
         //ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox.ToString(), true);  //修正BUG
         Response.Write("<script type=\"text/javascript\">" + msbox + "</script>");
         Response.End();
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 检查管理员权限
        /// </summary>
        /// <param name="nav_name">菜单名称</param>
        /// <param name="action_type">操作类型</param>
        public void ChkAdminLevel(string nav_name, string action_type)
        {
            Model.manager model = GetAdminInfo();
            BLL.manager_role bll = new BLL.manager_role();
            bool result = bll.Exists(model.role_id, nav_name, action_type);

            if (!result)
            {
                string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\", \"Error\")";
                Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                Response.End();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 检查管理员权限
        /// </summary>
        /// <param name="nav_name">菜单名称</param>
        /// <param name="action_type">操作类型</param>
        public void ChkAdminLevel(string nav_name, string action_type)
        {
            Model.xiehui     model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (!result)
            {
                string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\")";
                Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                Response.End();
            }
        }
Ejemplo n.º 6
0
        public void ChkAdminLevelEdit(string nav_name, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (!result)
            {
                string msgbox = "parent.jsdialog(\"錯誤提示\", \"您沒有管理該頁面的操作許可權,無法操作!\", \"back\")";
                Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                Response.End();
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 检查管理员权限
        /// </summary>
        /// <param name="channel_id">频道ID</param>
        /// <param name="action_type">操作类型</param>
        public void ChkAdminLevel(int channel_id, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, channel_id, action_type);

            if (!result)
            {
                string msbox = "parent.f_errorTab(\"错误提示\", \"您没有管理该页面的权限,请勿尝试非法进入!\")";
                //ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox.ToString(), true);  //修正BUG
                Response.Write("<script type=\"text/javascript\">" + msbox + "</script>");
                Response.End();
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 檢查管理員許可權
        /// </summary>
        /// <param name="nav_name">菜單名稱</param>
        /// <param name="action_type">操作類型</param>
        public bool ChkAdminLevel(string nav_name, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            return(result);
            //if (!result)
            //{
            //    string msgbox = "parent.jsdialog(\"錯誤提示\", \"您沒有管理該頁面的許可權,無法進入!\", \"back\")";
            //    Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
            //    Response.End();
            //}
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 检查管理员权限
        /// </summary>
        /// <param name="nav_name">菜单名称</param>
        /// <param name="action_type">操作类型</param>
        public void ChkAdminLevel(string nav_name, string action_type)
        {
            int i;

            if (Int32.TryParse(action_type, out i))
            {
                action_type = Enum.GetName(typeof(DTEnums.ActionEnum), i);
            }
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (!result)
            {
                string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\")";
                Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                Response.End();
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 检查管理员权限
 /// </summary>
 /// <param name="channel_name">栏目名称</param>
 /// <param name="action_type">操作类型</param>
 /// <returns>bool</returns>
 public bool IsAdminLevel(string channel_name, string action_type)
 {
     Model.manager model = GetAdminInfo();
     BLL.manager_role bll = new BLL.manager_role();
     return bll.Exists(model.role_id, channel_name, action_type);
 }
Ejemplo n.º 11
0
 public bool ChkAdminLevelReturn(string nav_name, string action_type)
 {
     Model.manager    model = GetAdminInfo();
     BLL.manager_role bll   = new BLL.manager_role();
     return(bll.Exists(model.role_id, nav_name, action_type));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 检查管理员权限
 /// </summary>
 /// <param name="channel_name">栏目名称</param>
 /// <param name="action_type">操作类型</param>
 /// <returns>bool</returns>
 public bool IsAdminLevel(string channel_name, string action_type)
 {
     Model.manager    model = GetAdminInfo();
     BLL.manager_role bll   = new BLL.manager_role();
     return(bll.Exists(model.role_id, channel_name, action_type));
 }
Ejemplo n.º 13
0
        private void save_Order(HttpContext context)
        {
            string oID           = DTRequest.GetFormString("orderID");
            int    cid           = DTRequest.GetFormInt("hCusId", 0);
            int    coid          = DTRequest.GetFormInt("ddlcontact", 0);
            string contractPrice = DTRequest.GetFormString("ddlcontractPrice");
            string sdate         = DTRequest.GetFormString("txtsDate");
            string edate         = DTRequest.GetFormString("txteDate");
            string address       = DTRequest.GetFormString("txtAddress");
            string content       = DTRequest.GetFormString("txtContent");
            string contract      = DTRequest.GetFormString("txtContract");
            string remark        = DTRequest.GetFormString("txtRemark");
            string place         = DTRequest.GetFormString("hide_place");
            int    fstatus       = DTRequest.GetFormInt("ddlfStatus", 0);
            string employee0     = DTRequest.GetFormString("hide_employee0");
            string employee1     = DTRequest.GetFormString("hide_employee1");
            string employee2     = DTRequest.GetFormString("hide_employee2");
            string employee3     = DTRequest.GetFormString("hide_employee3");
            string employee4     = DTRequest.GetFormString("hide_employee4");
            string pushStatus    = DTRequest.GetFormString("ddlpushStatus");

            Model.Order order = new Model.Order();
            order.o_id              = oID;
            order.o_cid             = cid;
            order.o_coid            = coid;
            order.o_content         = content;
            order.o_address         = address;
            order.o_contractPrice   = contractPrice;
            order.o_contractContent = contract;
            order.o_sdate           = ConvertHelper.toDate(sdate);
            order.o_edate           = ConvertHelper.toDate(edate);
            order.o_place           = place;
            order.o_status          = (byte)fstatus;
            order.o_isPush          = pushStatus == "True" ? true : false;
            order.o_remarks         = remark;
            string[] list = new string[] { }, pli = new string[] { };
            #region  单人
            if (!string.IsNullOrEmpty(employee0))
            {
                pli = employee0.Split('|');
                order.personlist.Add(new Model.OrderPerson()
                {
                    op_type = 1, op_name = pli[0], op_number = pli[1], op_area = pli[2], op_addTime = DateTime.Now
                });
            }
            #endregion
            #region 业务报账员
            if (!string.IsNullOrEmpty(employee1))
            {
                pli = new string[] { };
                pli = employee1.Split('|');
                order.personlist.Add(new Model.OrderPerson()
                {
                    op_type = 2, op_name = pli[0], op_number = pli[1], op_area = pli[2], op_addTime = DateTime.Now
                });
            }
            #endregion
            #region 业务策划人员
            if (!string.IsNullOrEmpty(employee2))
            {
                pli  = new string[] { };
                list = employee2.Split(',');
                foreach (string item in list)
                {
                    pli = item.Split('|');
                    order.personlist.Add(new Model.OrderPerson()
                    {
                        op_type = 3, op_name = pli[0], op_number = pli[1], op_area = pli[2], op_dstatus = Utils.ObjToByte(pli[3]), op_addTime = DateTime.Now
                    });
                }
            }
            #endregion
            #region 业务执行人员
            if (!string.IsNullOrEmpty(employee3))
            {
                list = new string[] { };
                pli  = new string[] { };
                list = employee3.Split(',');
                foreach (string item in list)
                {
                    pli = item.Split('|');
                    order.personlist.Add(new Model.OrderPerson()
                    {
                        op_type = 4, op_name = pli[0], op_number = pli[1], op_area = pli[2], op_addTime = DateTime.Now
                    });
                }
            }
            #endregion
            #region 业务设计人员
            if (!string.IsNullOrEmpty(employee4))
            {
                pli  = new string[] { };
                list = employee4.Split(',');
                foreach (string item in list)
                {
                    pli = item.Split('|');
                    order.personlist.Add(new Model.OrderPerson()
                    {
                        op_type = 5, op_name = pli[0], op_number = pli[1], op_area = pli[2], op_dstatus = Utils.ObjToByte(pli[3]), op_addTime = DateTime.Now
                    });
                }
            }
            #endregion
            string           oid     = string.Empty;
            string           result  = string.Empty;
            BLL.manager_role bll     = new BLL.manager_role();
            Model.manager    manager = new ManagePage().GetAdminInfo();
            if (string.IsNullOrEmpty(oID))
            {
                if (!bll.Exists(manager.role_id, "sys_order_add", "Add"))
                {
                    context.Response.Write("{ \"msg\":\"您没有管理该页面的权限,请勿非法进入!\", \"status\":\"1\" }");
                    return;
                }
                result = new BLL.Order().AddOrder(order, manager, out oid);
            }
            else
            {
                if (!bll.Exists(manager.role_id, "sys_order_add", "Edit"))
                {
                    context.Response.Write("{ \"msg\":\"您没有管理该页面的权限,请勿非法进入!\", \"status\":\"1\" }");
                    return;
                }
                oid    = oID;
                result = new BLL.Order().UpdateOrder(order, manager);
            }
            if (string.IsNullOrEmpty(result))
            {
                context.Response.Write("{ \"msg\":\"" + oid + "\", \"status\":\"0\" }");
                return;
            }
            context.Response.Write("{ \"msg\":\"" + result + "\", \"status\":\"1\" }");
            return;
        }