/// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns></returns>
 /// <remarks>2013-08-01  朱成果 创建</remarks>
 public override void Update(SyPermission entity)
 {
     Context.Update("SyPermission", entity)
     .AutoMap(o => o.SysNo)
     .Where("SysNo", entity.SysNo)
     .Execute();
 }
Beispiel #2
0
        /// <summary>
        /// 向指定用户组添加所有的菜单权限
        /// </summary>
        /// <param name="userGroupSysNo">用户组编号</param>
        /// <returns>void</returns>
        /// <remarks>2013-10-11 朱家宏 创建</remarks>
        public void AssignAllMenuPrivilegeToUserGroup(int userGroupSysNo)
        {
            var userGroup  = DataAccess.Sys.ISyUserGroupDao.Instance.GetEntity(userGroupSysNo);
            var groupMeuns = new List <SyUserGroupMenu>();

            var menus = DataAccess.Sys.ISyMenuDao.Instance.GetAll();

            foreach (var menu in menus)
            {
                groupMeuns.Add(new SyUserGroupMenu()
                {
                    UserGroupID = userGroup.SysNo,
                    MenuID      = menu.SysNo,
                    MenuType    = 0
                });

                var privileges = DataAccess.Sys.ISyPrivilegeDao.Instance.GetListByMenu(menu.SysNo);
                foreach (var p in privileges)
                {
                    groupMeuns.Add(new SyUserGroupMenu()
                    {
                        UserGroupID = userGroup.SysNo,
                        MenuID      = p.SysNo,
                        MenuType    = 1
                    });
                }
            }

            DataAccess.Sys.ISyPermissionDao.Instance.Delete((int)SystemStatus.授权来源.用户组, userGroup.SysNo);

            if (userGroup.SysNo > 0)//添加菜单权限
            {
                foreach (SyUserGroupMenu item in groupMeuns)
                {
                    var p = new SyPermission
                    {
                        CreatedBy      = userGroup.CreatedBy,
                        CreatedDate    = DateTime.Now,
                        EffectiveDate  = DateTime.Now,
                        ExpirationDate = DateTime.MaxValue,
                        LastUpdateBy   = userGroup.CreatedBy,
                        LastUpdateDate = DateTime.Now,
                        Source         = (int)SystemStatus.授权来源.用户组,
                        SourceSysNo    = userGroup.SysNo,
                        Target         = item.MenuType == 1 ? (int)SystemStatus.授权目标.权限 : (int)SystemStatus.授权目标.菜单,
                        TargetSysNo    = item.MenuID
                    };
                    DataAccess.Sys.ISyPermissionDao.Instance.Insert(p);
                }
            }
        }
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns>新增记录编号</returns>
 /// <remarks>2013-08-01  朱成果 创建</remarks>
 public override int Insert(SyPermission entity)
 {
     if (entity.EffectiveDate == DateTime.MinValue)
     {
         entity.EffectiveDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
     }
     if (entity.ExpirationDate == DateTime.MinValue)
     {
         entity.ExpirationDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
     }
     entity.SysNo = Context.Insert("SyPermission", entity)
                    .AutoMap(o => o.SysNo)
                    .ExecuteReturnLastId <int>("SysNo");
     return(entity.SysNo);
 }
Beispiel #4
0
        private void AddBaseTaskObjectToList(List <BaseTask> listObject)
        {
            BaseTask bsAT                    = new BsArea();
            BaseTask bsDP                    = new BsDeliveryPayment();
            BaseTask bsPT                    = new BsPaymentType();
            BaseTask bsCode                  = new BsCode();
            BaseTask bsOrganization          = new BsOrganization();
            BaseTask bsOrganizationWarehouse = new BsOrganizationWarehouse();

            BaseTask crCustomer = new CrCustomer();
            BaseTask crCL       = new CrCustomerLevel();
            BaseTask crCQ       = new CrCustomerQuestion();
            BaseTask crRA       = new CrReceiveAddress();

            BaseTask dsMallType      = new DsMallType();
            BaseTask dsDealerLevel   = new DsDealerLevel();
            BaseTask feArticle       = new FeArticle();
            BaseTask feAC            = new FeArticleCategory();
            BaseTask feCS            = new FeCommentSupport();
            BaseTask fepc            = new FeProductComment();
            BaseTask fePCI           = new FeProductCommentImage();
            BaseTask fePCR           = new FeProductCommentReply();
            BaseTask feSearchKeyword = new FeSearchKeyword();
            BaseTask feadvertgroup   = new FeAdvertGroup();
            BaseTask feadvertitem    = new FeAdvertItem();
            BaseTask feproductgroup  = new FeProductGroup();
            BaseTask feproductitem   = new FeProductItem();

            BaseTask fnIT      = new FnInvoiceType();
            BaseTask fninvoice = new FnInvoice();

            BaseTask fnpv = new  FnReceiptVoucher();
            BaseTask fnReceiptVoucherItem = new FnReceiptVoucherItem();
            BaseTask fnop                 = new FnOnlinePayment();
            BaseTask fnPaymentVoucher     = new FnPaymentVoucher();
            BaseTask fnPaymentVoucherItem = new FnPaymentVoucherItem();

            BaseTask lgDelivery              = new LgDelivery();
            BaseTask lgDI                    = new LgDeliveryItem();
            BaseTask lgDS                    = new LgDeliveryScope();
            BaseTask lgDT                    = new LgDeliveryType();
            BaseTask lgDUC                   = new LgDeliveryUserCredit();
            BaseTask lgPT                    = new LgPickupType();
            BaseTask lgsettlement            = new LgSettlement();
            BaseTask lgSI                    = new LgSettlementItem();
            BaseTask lgDeliveryPrintTemplate = new LgDeliveryPrintTemplate();
            BaseTask pdAttribute             = new PdAttribute();
            BaseTask pdAG                    = new PdAttributeGroup();
            BaseTask pdAGA                   = new PdAttributeGroupAssociation();
            BaseTask pdAO                    = new PdAttributeOption();
            BaseTask pdBrand                 = new PdBrand();
            BaseTask pdCGA                   = new PdCatAttributeGroupAso();
            BaseTask pdCategory              = new PdCategory();
            BaseTask pdCA                    = new PdCategoryAssociation();
            BaseTask pdPrice                 = new PdPrice();
            BaseTask pdProduct               = new PdProduct();
            BaseTask pdPA                    = new PdProductAssociation();
            BaseTask pdProductAttribute      = new PdProductAttribute();
            BaseTask pdPI                    = new PdProductImage();
            BaseTask pdTemplate              = new PdTemplate();
            BaseTask pdProductStatistics     = new PdProductStatistics();

            BaseTask soOrder         = new SoOrder();
            BaseTask soOrderItem     = new SoOrderItem();
            BaseTask soRA            = new SoReceiveAddress();
            BaseTask SyUG            = new SyUserGroup();
            BaseTask syGU            = new SyGroupUser();
            BaseTask syMenu          = new SyMenu();
            BaseTask syMenuPrivilege = new SyMenuPrivilege();
            BaseTask syPrivilege     = new SyPrivilege();
            BaseTask syRole          = new SyRole();
            BaseTask syRoleMenu      = new SyRoleMenu();
            BaseTask syRolePrivilege = new SyRolePrivilege();
            BaseTask syPermission    = new SyPermission();
            BaseTask syUser          = new SyUser();
            BaseTask syUW            = new SyUserWarehouse();
            BaseTask syMyMenu        = new SyMyMenu();

            BaseTask spcombo                  = new SpCombo();
            BaseTask spComboItem              = new SpComboItem();
            BaseTask spcopon                  = new spcoupon();
            BaseTask sqpromotion              = new SPpromotion();
            BaseTask spromotiongift           = new SPpromotiongift();
            BaseTask sppromotionoverlay       = new SPpromotionoverlay();
            BaseTask sppromotionrule          = new SPpromotionrule();
            BaseTask sppromotionrulecondition = new SPpromotionrulecondition();
            BaseTask sppromotionrulekeyvalue  = new SPpromotionrulekeyvalue();
            BaseTask syTaskConfig             = new SyTaskConfig();

            BaseTask whStockOut     = new WhStockOut();
            BaseTask whStockOutItem = new WhstockOutItem();
            BaseTask whwarehouse    = new WhWarehouse();
            BaseTask whwa           = new WHwarehousearea();
            BaseTask whwdy          = new WHwarehouseDeliveryType();
            BaseTask whWPT          = new WhWarehousePickupType();
            BaseTask whstockin      = new WhStockIn();
            BaseTask whstockinItem  = new WHStockinItem();
            BaseTask rcReturn       = new RCReturn();
            BaseTask rcReturnItem   = new RcReturnItem();

            listObject.Add(bsAT);
            listObject.Add(bsDP);
            listObject.Add(bsPT);
            listObject.Add(bsCode);
            listObject.Add(bsOrganization);
            listObject.Add(bsOrganizationWarehouse);

            listObject.Add(crCustomer);
            listObject.Add(crCL);
            listObject.Add(crCQ);
            listObject.Add(crRA);
            listObject.Add(dsMallType);
            listObject.Add(dsDealerLevel);
            listObject.Add(feArticle);
            listObject.Add(feAC);
            listObject.Add(feCS);
            listObject.Add(fePCI);
            listObject.Add(fePCR);
            listObject.Add(fepc);
            listObject.Add(feSearchKeyword);
            listObject.Add(feadvertgroup);
            listObject.Add(feadvertitem);
            listObject.Add(feproductgroup);
            listObject.Add(feproductitem);

            listObject.Add(fnIT);
            listObject.Add(fnpv);
            listObject.Add(fnReceiptVoucherItem);
            listObject.Add(fnop);
            listObject.Add(fninvoice);

            listObject.Add(fnPaymentVoucher);
            listObject.Add(fnPaymentVoucherItem);

            listObject.Add(lgDelivery);
            listObject.Add(lgDI);
            listObject.Add(lgDS);
            listObject.Add(lgDT);
            listObject.Add(lgPT);
            listObject.Add(lgsettlement);
            listObject.Add(lgSI);
            listObject.Add(lgDeliveryPrintTemplate);

            listObject.Add(pdAttribute);
            listObject.Add(pdAG);
            listObject.Add(pdAGA);
            listObject.Add(pdAO);
            listObject.Add(pdBrand);
            listObject.Add(pdCGA);
            listObject.Add(pdCategory);
            listObject.Add(pdCA);
            listObject.Add(pdPrice);
            listObject.Add(pdProduct);
            listObject.Add(pdPA);
            listObject.Add(pdProductAttribute);
            listObject.Add(pdTemplate);
            listObject.Add(pdProductStatistics);

            listObject.Add(soOrder);
            listObject.Add(soOrderItem);

            listObject.Add(spcombo);
            listObject.Add(spComboItem);
            listObject.Add(spcopon);
            listObject.Add(sqpromotion);
            listObject.Add(spromotiongift);
            //listObject.Add(sppromotionoverlay);
            listObject.Add(sppromotionrule);
            listObject.Add(sppromotionrulecondition);
            listObject.Add(sppromotionrulekeyvalue);

            listObject.Add(syGU);
            listObject.Add(syUW);
            listObject.Add(SyUG);
            listObject.Add(syMenu);
            listObject.Add(syUser);
            listObject.Add(syPermission);

            listObject.Add(syMenuPrivilege);
            listObject.Add(syPrivilege);
            listObject.Add(syRole);
            listObject.Add(syRoleMenu);
            listObject.Add(syRolePrivilege);
            listObject.Add(syMyMenu);
            listObject.Add(syTaskConfig);

            listObject.Add(whStockOut);
            listObject.Add(whStockOutItem);
            listObject.Add(whwarehouse);
            listObject.Add(whwa);
            listObject.Add(whwdy);
            listObject.Add(whWPT);
            listObject.Add(whstockin);
            listObject.Add(whstockinItem);
            listObject.Add(rcReturn);
            listObject.Add(rcReturnItem);
            listObject.Add(lgDUC);
            listObject.Add(pdPI);
            listObject.Add(soRA);
        }
Beispiel #5
0
 /// <summary>
 /// 用户组
 /// </summary>
 /// <param name="model">用户组</param>
 /// <param name="groupMeuns">菜单权限</param>
 /// <param name="groupRoles">角色</param>
 /// <returns></returns>
 /// <remarks>2013-08-05 朱成果 创建</remarks>
 public void SaveUserGroup(SyUserGroup model, List <SyUserGroupMenu> groupMeuns, List <SyUserGroupRole> groupRoles)
 {
     if (model.SysNo < 1)//新建
     {
         #region 新建
         if (GetByGroupName(model.GroupName) != null)
         {
             throw new Exception("用户组名已经存在");
         }
         model.SysNo = Hyt.DataAccess.Sys.ISyUserGroupDao.Instance.Insert(model); //添加用户组
         if (groupMeuns != null && model.SysNo > 0)                               //添加菜单权限
         {
             foreach (SyUserGroupMenu item in groupMeuns)
             {
                 var p = new SyPermission
                 {
                     CreatedBy      = model.CreatedBy,
                     CreatedDate    = DateTime.Now,
                     EffectiveDate  = DateTime.Now,
                     ExpirationDate = DateTime.MaxValue,
                     LastUpdateBy   = model.CreatedBy,
                     LastUpdateDate = DateTime.Now,
                     Source         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权来源.用户组,
                     SourceSysNo    = model.SysNo,
                     Target         = item.MenuType == 1 ? (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.权限 : (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.菜单,
                     TargetSysNo    = item.MenuID
                 };
                 Hyt.DataAccess.Sys.ISyPermissionDao.Instance.Insert(p);
             }
         }
         if (groupRoles != null && model.SysNo > 0)//添加角色
         {
             foreach (SyUserGroupRole item in groupRoles)
             {
                 var r = new SyPermission
                 {
                     CreatedBy      = model.CreatedBy,
                     CreatedDate    = DateTime.Now,
                     EffectiveDate  = DateTime.Now,
                     ExpirationDate = DateTime.MaxValue,
                     LastUpdateBy   = model.CreatedBy,
                     LastUpdateDate = DateTime.Now,
                     Source         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权来源.用户组,
                     SourceSysNo    = model.SysNo,
                     Target         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.角色,
                     TargetSysNo    = item.RoleID
                 };
                 Hyt.DataAccess.Sys.ISyPermissionDao.Instance.Insert(r);
             }
         }
         #endregion
     }
     else //编辑
     {
         #region 编辑
         Hyt.DataAccess.Sys.ISyUserGroupDao.Instance.Update(model);
         Hyt.DataAccess.Sys.ISyPermissionDao.Instance.Delete((int)Hyt.Model.WorkflowStatus.SystemStatus.授权来源.用户组, model.SysNo);
         if (groupMeuns != null && model.SysNo > 0)//添加菜单权限
         {
             foreach (SyUserGroupMenu item in groupMeuns)
             {
                 var p = new SyPermission
                 {
                     CreatedBy      = model.CreatedBy,
                     CreatedDate    = DateTime.Now,
                     EffectiveDate  = DateTime.Now,
                     ExpirationDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MaxValue,// DateTime.MaxValue,
                     LastUpdateBy   = model.CreatedBy,
                     LastUpdateDate = DateTime.Now,
                     Source         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权来源.用户组,
                     SourceSysNo    = model.SysNo,
                     Target         = item.MenuType == 1 ? (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.权限 : (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.菜单,
                     TargetSysNo    = item.MenuID
                 };
                 Hyt.DataAccess.Sys.ISyPermissionDao.Instance.Insert(p);
             }
         }
         if (groupRoles != null && model.SysNo > 0)//添加角色
         {
             foreach (SyUserGroupRole item in groupRoles)
             {
                 var r = new SyPermission
                 {
                     CreatedBy      = model.CreatedBy,
                     CreatedDate    = DateTime.Now,
                     EffectiveDate  = DateTime.Now,
                     ExpirationDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MaxValue,// DateTime.MaxValue,
                     LastUpdateBy   = model.CreatedBy,
                     LastUpdateDate = DateTime.Now,
                     Source         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权来源.用户组,
                     SourceSysNo    = model.SysNo,
                     Target         = (int)Hyt.Model.WorkflowStatus.SystemStatus.授权目标.角色,
                     TargetSysNo    = item.RoleID
                 };
                 Hyt.DataAccess.Sys.ISyPermissionDao.Instance.Insert(r);
             }
         }
         #endregion
     }
 }
Beispiel #6
0
 /// <summary>
 /// 创建授权
 /// </summary>
 /// <param name="syPermission">授权</param>
 /// <returns></returns>
 /// <remarks>2013-08-08  黄志勇 创建</remarks>
 public void InsertSyPermission(SyPermission syPermission)
 {
     syPermission.SysNo = ISyPermissionDao.Instance.Insert(syPermission);
 }
Beispiel #7
0
        /// <summary>
        /// 添加三期基础任务对象
        /// </summary>
        /// <param name="listObject"></param>
        private void AddBaseTaskObject3ToList(List <BaseTask> listObject)
        {
            BaseTask bsDP                    = new BsDeliveryPayment();
            BaseTask bsPT                    = new BsPaymentType();
            BaseTask bsCode                  = new BsCode();
            BaseTask bsOrganization          = new BsOrganization();
            BaseTask bsOrganizationWarehouse = new BsOrganizationWarehouse();

            BaseTask dsMallType    = new DsMallType();
            BaseTask dsDealerLevel = new DsDealerLevel();

            BaseTask feSearchKeyword = new FeSearchKeyword();
            BaseTask feadvertgroup   = new FeAdvertGroup();
            BaseTask feadvertitem    = new FeAdvertItem();
            BaseTask feproductgroup  = new FeProductGroup();
            BaseTask feproductitem   = new FeProductItem();

            BaseTask fnIT = new FnInvoiceType();

            BaseTask lgDT = new LgDeliveryType();
            BaseTask lgPT = new LgPickupType();
            BaseTask lgDeliveryPrintTemplate = new LgDeliveryPrintTemplate();

            BaseTask pdProductStatistics = new PdProductStatistics();

            BaseTask SyUG            = new SyUserGroup();
            BaseTask syGU            = new SyGroupUser();
            BaseTask syMenu          = new SyMenu();
            BaseTask syMenuPrivilege = new SyMenuPrivilege();
            BaseTask syPrivilege     = new SyPrivilege();
            BaseTask syRole          = new SyRole();
            BaseTask syRoleMenu      = new SyRoleMenu();
            BaseTask syRolePrivilege = new SyRolePrivilege();
            BaseTask syPermission    = new SyPermission();
            BaseTask syMyMenu        = new SyMyMenu();
            BaseTask syTaskConfig    = new SyTaskConfig();

            BaseTask spcombo                  = new SpCombo();
            BaseTask spComboItem              = new SpComboItem();
            BaseTask spcopon                  = new spcoupon();
            BaseTask sqpromotion              = new SPpromotion();
            BaseTask spromotiongift           = new SPpromotiongift();
            BaseTask sppromotionoverlay       = new SPpromotionoverlay();
            BaseTask sppromotionrule          = new SPpromotionrule();
            BaseTask sppromotionrulecondition = new SPpromotionrulecondition();
            BaseTask sppromotionrulekeyvalue  = new SPpromotionrulekeyvalue();

            BaseTask whwdy = new WHwarehouseDeliveryType();
            BaseTask whWPT = new WhWarehousePickupType();

            listObject.Add(bsDP);
            listObject.Add(bsPT);
            listObject.Add(bsCode);
            listObject.Add(bsOrganization);
            listObject.Add(bsOrganizationWarehouse);

            listObject.Add(dsMallType);
            listObject.Add(dsDealerLevel);

            listObject.Add(feSearchKeyword);
            listObject.Add(feadvertgroup);
            listObject.Add(feadvertitem);
            listObject.Add(feproductgroup);
            listObject.Add(feproductitem);

            listObject.Add(fnIT);

            listObject.Add(lgDT);
            listObject.Add(lgPT);
            listObject.Add(lgDeliveryPrintTemplate);

            listObject.Add(pdProductStatistics);

            listObject.Add(spcombo);
            listObject.Add(spComboItem);
            listObject.Add(spcopon);
            listObject.Add(sqpromotion);
            listObject.Add(spromotiongift);
            //listObject.Add(sppromotionoverlay);
            listObject.Add(sppromotionrule);
            listObject.Add(sppromotionrulecondition);
            listObject.Add(sppromotionrulekeyvalue);

            listObject.Add(syGU);
            listObject.Add(SyUG);
            listObject.Add(syMenu);
            listObject.Add(syPermission);

            listObject.Add(syMenuPrivilege);
            listObject.Add(syPrivilege);
            listObject.Add(syRole);
            listObject.Add(syRoleMenu);
            listObject.Add(syRolePrivilege);
            listObject.Add(syMyMenu);
            listObject.Add(syTaskConfig);

            listObject.Add(whwdy);
            listObject.Add(whWPT);
        }
Beispiel #8
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns>新增记录编号</returns>
 /// <remarks>2013-08-08  朱成果 创建</remarks>
 public int Insert(SyPermission entity)
 {
     return(ISyPermissionDao.Instance.Insert(entity));
 }
Beispiel #9
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns></returns>
 /// <remarks>2013-08-01  朱成果 创建</remarks>
 public abstract void Update(SyPermission entity);
Beispiel #10
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns>新增记录编号</returns>
 /// <remarks>2013-08-01  朱成果 创建</remarks>
 public abstract int Insert(SyPermission entity);