private void BasicSettingForm_Load(object sender, EventArgs e) { PermissonUtil.CheckPermissons(costumeBrandCtrl); PermissonUtil.CheckPermissons(costumeClassCtrl); PermissonUtil.CheckPermissons(costumeColorCtrl); PermissonUtil.CheckPermissons(costumeSeasonCtrl); PermissonUtil.CheckPermissons(sizeGroupCtrl); }
public void UpdatePermisson() { UserInfo user = CommonGlobalCache.CurrentUser; List <int> permissons = user.RolePermissions; foreach (var item in skinFlowLayoutPanel1.Controls) { if (item is WorkDeskMenuItem) { WorkDeskMenuItem mi = item as WorkDeskMenuItem; mi.Enabled = PermissonUtil.HasMenuPermisson(CommonGlobalCache.CurrentUser, mi.Tag); } } }
public void Search() { try { string memberID = this.SkinTxt.Text.Trim(); if (string.IsNullOrEmpty(memberID)) { MemberSelected?.Invoke(null); return; } if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } resultList = CommonGlobalCache.ServerProxy.GetMembersLike4IDOrName(memberID); if (resultList != null && PermissonUtil.HasPermission(RolePermissionMenuEnum.会员管理, RolePermissionEnum.查看_只看本店)) { resultList = resultList.FindAll(t => t.ShopID == CommonGlobalCache.CurrentShopID); } if (resultList == null || resultList.Count == 0) { MemberSelected?.Invoke(null); return; } if (resultList.Count == 1) { this.SkinTxt.Text = resultList[0].PhoneNumber; MemberSelected?.Invoke(resultList[0]); } else { MemberSelectForm memberForm = new MemberSelectForm(memberID, resultList); memberForm.MemberSelected += MemberForm_MemberSelected; memberForm.ShowDialog(); } } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } }
private void Initialize() { skinTreeViewPermisson.Nodes.AddRange(PermissonUtil.GetTreeNodes().ToArray()); allNodes = WinformUIUtil.GetAllTreeNodes(skinTreeViewPermisson.Nodes); skinTreeViewPermisson.Nodes[0].FirstNode.ExpandAll(); dataGridView1.AutoGenerateColumns = false; dataGridViewPagingSumCtrl = new DataGridViewPagingSumCtrl(this.dataGridView1); dataGridViewPagingSumCtrl.ShowRowCounts = false; dataGridViewPagingSumCtrl.Initialize(); //List<UserInfo> adminList = new List<UserInfo>(); //foreach (var item in CommonGlobalCache.UserInfoList) //{ // if (item.State == 0) // { // if (item == CommonGlobalCache.GetSupperUserInfo()) { continue; } // adminList.Add(item); // } //} //adminList.Insert(0, CommonGlobalCache.GetSupperUserInfo()); LoadRoles(); }
public bool HasPermission(RolePermissionEnum permission) { return(PermissonUtil.HasPermission(MenuPermission, permission)); }
private void OrayForm_Load(object sender, EventArgs e) { PermissonUtil.CheckPermissons(this); }
/// <summary> /// 初始化缓存列表 /// </summary> private static void InitializeCache() { try { int total = 19; int sleep = 20; CommonGlobalCache.iniProgress(total, "加载中……"); #region 权限 CommonGlobalCache.updateProgress("权限"); if (GlobalCache.currentUser == null) { InteractResult <UserInfo> userInfo = GlobalCache.ServerProxy.GetUserInfo(CommonGlobalCache.CurrentUserID); GlobalCache.currentUser = userInfo.Data; GlobalCache.IsPos = GlobalCache.currentUser.Type == UserInfoType.Guide; } #endregion #region 用户信息 CommonGlobalCache.updateProgress("用户信息"); ////season if (GlobalCache.adminUserList == null) { GlobalCache.adminUserList = GlobalCache.ServerProxy.GetAllAdminUser(); } #endregion #region 店铺信息 CommonGlobalCache.updateProgress("店铺信息"); if (GlobalCache.ShopList == null) { GlobalCache.generalStoreShopID = GlobalCache.ServerProxy.GetGeneralStoreShopID(); GlobalCache.currentShopID = GlobalCache.currentUser.ShopId; GlobalCache.ShopList = GlobalCache.ServerProxy.GetShopList(); // GlobalCache.eMall = GlobalCache.EMallServerProxy.GetEMall(); } #endregion #region 导购 CommonGlobalCache.updateProgress("导购"); if (GlobalCache.guideList == null) { List <Guide> guideList = GlobalCache.ServerProxy.GetGuideList(string.Empty); GlobalCache.guideList = guideList; } #endregion #region 促销活动 CommonGlobalCache.updateProgress("促销活动"); if (salesPromotionList == null) { GetSalesPromotionListPara getSalesPromotionListPara = new GetSalesPromotionListPara(); getSalesPromotionListPara.PromotionType = (int)PromotionTypeEnum.Null; salesPromotionList = GlobalCache.ServerProxy.GetSalesPromotionList(getSalesPromotionListPara); } #endregion #region 充值规则 CommonGlobalCache.updateProgress("充值规则"); if (rechargeDonateRuleList == null) { GlobalCache.rechargeDonateRuleList = GlobalCache.ServerProxy.GetRechargeDonateRuleList(); RechargeDonateRule rechargeDonateRule = GlobalCache.rechargeDonateRuleList[0]; if (rechargeDonateRule != null) { GlobalCache.RechargeDonateRule = rechargeDonateRule; } } #endregion #region 装颜色 CommonGlobalCache.updateProgress("服装颜色"); if (GlobalCache.costumeColorList == null) { GlobalCache.costumeColorList = GlobalCache.ServerProxy.GetCostumeColor(); } #endregion #region 年份 CommonGlobalCache.updateProgress("年份"); List <int> list = YearHelper.GetYearList(DateTime.Now); foreach (int year in list) { GlobalCache.yearList.Add(new ListItem <int>(year.ToString(), year)); } #endregion #region 品牌 CommonGlobalCache.updateProgress("品牌"); if (GlobalCache.brandList == null) { // List<Brand> bList= GlobalCache.ServerProxy.GetBrand().FindAll(t=>t.IsDisable=false); List <Brand> bList = GlobalCache.ServerProxy.GetEnableBrands().Data; GlobalCache.brandList = bList; GlobalCache.brandList?.Sort(); } #endregion #region 菜单 GlobalCache.Permissons = WinformUIUtil.GetAllTreeNodes(PermissonUtil.GetTreeNodes()); GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.工作台)); if (CommonGlobalCache.CurrentUserID == SystemDefault.DefaultAdmin) { GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.管理员)); } GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.退出)); #endregion #region 配置 CommonGlobalCache.updateProgress("配置"); if (GlobalCache.parameterConfigList == null) { GlobalCache.parameterConfigList = GlobalCache.ServerProxy.GetAllParameterConfig(); SetParams(); } #endregion #region 促销类型 CommonGlobalCache.updateProgress("促销类型"); if (GlobalCache.promotionTypeEnumList == null) { List <ListItem <PromotionTypeEnum> > promotionTypeList = new List <ListItem <PromotionTypeEnum> >(); promotionTypeList.Add(new ListItem <PromotionTypeEnum>(GlobalUtil.COMBOBOX_ALL, PromotionTypeEnum.Null)); promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.MJ), PromotionTypeEnum.MJ)); promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.Discount), PromotionTypeEnum.Discount)); promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.YKJ), PromotionTypeEnum.YKJ)); GlobalCache.promotionTypeEnumList = promotionTypeList; } #endregion #region 供应商 CommonGlobalCache.updateProgress("供应商"); if (GlobalCache.supplierList == null) { GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList(); GlobalCache.supplierList?.Sort(); } #endregion if (GlobalCache.distributorMemberList == null) { GlobalCache.distributorMemberList = (List <TreeModel>)CommonGlobalCache.ServerProxy.GetRetailDistributionTree().Data; // GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList(); } if (GlobalCache.distributorPFMemberList == null) { GlobalCache.distributorPFMemberList = (List <TreeModel>)CommonGlobalCache.ServerProxy.GetPfDistributionTree().Data; /* GetDistributorPagePara para = new GetDistributorPagePara() * { * IdOrName = null, * PageIndex = 0, * PageSize = int.MaxValue * }; * DistributorPage page = GlobalCache.ServerProxy.GetDistributorPage(para); * List<TreeModel> listM = new List<TreeModel>(); * List<Distributor> Dlist = page.Distributors as List<Distributor>; * foreach (Distributor item in Dlist) * { * TreeModel curModel = new TreeModel(); * curModel.ID= item.ID; * curModel.AccruedCommission = item.AccruedCommission; * curModel.Name = item.Name; * listM.Add(curModel); * } * GlobalCache.distributorPFMemberList = listM;*/ // GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList(); } #region 装信息 CommonGlobalCache.updateProgress("服装信息"); if (costumeList == null) { LoadCostumeInfos(total, true); } //条形码 #endregion #region 尺码组 CommonGlobalCache.updateProgress("尺码组"); if (sizeGroupList == null) { sizeGroupList = GlobalCache.ServerProxy.GetAllSizeGroup(); } #endregion #region COS CommonGlobalCache.updateProgress("COS"); if (cosLoginInfo == null) { GlobalCache.cosLoginInfo = GlobalCache.EMallServerProxy.GetCosLoginInfo(); } #endregion #region 分销人员 CommonGlobalCache.updateProgress("分销人员"); if (GlobalCache.distributorList == null) { GetDistributorPagePara para = new GetDistributorPagePara() { IdOrName = null, PageIndex = 0, PageSize = int.MaxValue }; DistributorPage page = GlobalCache.ServerProxy.GetDistributorPage(para); GlobalCache.distributorList = page.Distributors; } #endregion #region 批发 CommonGlobalCache.updateProgress("批发"); PfCustomerCache.Load(); #endregion #region 商城 CommonGlobalCache.updateProgress("商城"); if (eMallMiniProgramImg == null) { byte[] imageByte = GlobalCache.ServerProxy.GetEMallMiniProgramImg(); if (imageByte != null) { eMallMiniProgramImg = CCWin.SkinControl.ImageHelper.Convert(imageByte); } } #endregion GlobalCache.updateProgress(""); GlobalCache.iniCompleted(); } catch (Exception ex) { CommonGlobalCache.iniFailed(ex); } }
public void HandleInformation(string sourceUserID, int informationType, byte[] info) { GlobalUtil.WriteLog("收到通知" + informationType); #region 充值规则更改 if (NoticeInformationTypes.UpdateRechargeDonateRule == informationType) { RechargeDonateRule rechargeDonateRule = CompactPropertySerializer.Default.Deserialize <RechargeDonateRule>(info, 0); GlobalCache.UpdateRechargeDonateRule(rechargeDonateRule); } else if (NoticeInformationTypes.DeleteRechargeDonateRule == informationType) { GlobalCache.DeleteRechargeDonateRule(); } else if (NoticeInformationTypes.UpdateShopRechargeRuleID == informationType) { RechargeDonateRule rechargeDonateRule = CompactPropertySerializer.Default.Deserialize <RechargeDonateRule>(info, 0); GlobalCache.UpdateShopRechargeRuleID(rechargeDonateRule); } #endregion #region 系统配置更改 else if (NoticeInformationTypes.UpdateParameterConfig == informationType) { ParameterConfig c = CompactPropertySerializer.Default.Deserialize <ParameterConfig>(info, 0); GlobalCache.ParameterConfig(c); } else if (NoticeInformationTypes.UpdateParameterConfigs == informationType) { List <ParameterConfig> collection = CompactPropertySerializer.Default.Deserialize <List <ParameterConfig> >(info, 0); foreach (var item in collection) { GlobalCache.ParameterConfig(item); } } #endregion #region 导购员信息更改 else if (NoticeInformationTypes.UpdateGuide == informationType) { Guide guide = CompactPropertySerializer.Default.Deserialize <Guide>(info, 0); GlobalCache.UpdateGuide(guide); } else if (NoticeInformationTypes.InsertGuide == informationType) { Guide guide = CompactPropertySerializer.Default.Deserialize <Guide>(info, 0); GlobalCache.InsertGuide(guide); } else if (NoticeInformationTypes.DeleteGuide == informationType) { string guideID = Encoding.UTF8.GetString(info); GlobalCache.DeleteGuide(guideID); } else if (NoticeInformationTypes.DeleteGuides == informationType) { List <String> guideIDs = CompactPropertySerializer.Default.Deserialize <List <String> >(info, 0); foreach (var guideID in guideIDs) { GlobalCache.DeleteGuide(guideID); } } #endregion #region 促销活动更改 else if (NoticeInformationTypes.InsertSalesPromotion == informationType) { SalesPromotion salesPromotion = CompactPropertySerializer.Default.Deserialize <SalesPromotion>(info, 0); GlobalCache.InsertSalesPromotion(salesPromotion); } else if (NoticeInformationTypes.DeleteSalesPromotion == informationType) { string salesPromotionID = Encoding.UTF8.GetString(info); GlobalCache.DeleteSalesPromotion(salesPromotionID); } else if (NoticeInformationTypes.UpdateSalesPromotion == informationType) { SalesPromotion salesPromotion = CompactPropertySerializer.Default.Deserialize <SalesPromotion>(info, 0); GlobalCache.UpdateSalesPromotion(salesPromotion); } #endregion #region 品牌配置更改 else if (NoticeInformationTypes.InsertBrand == informationType) { Brand brand = CompactPropertySerializer.Default.Deserialize <Brand>(info, 0); GlobalCache.InsertBrand(brand); } else if (NoticeInformationTypes.UpdateBrand == informationType) { Brand brand = CompactPropertySerializer.Default.Deserialize <Brand>(info, 0); GlobalCache.UpdateBrand(brand); } else if (NoticeInformationTypes.DeleteBrand == informationType) { int brandID = BitConverter.ToInt32(info, 0); GlobalCache.DeleteBrand(brandID); } #endregion #region 装信息更改 //新增服装 else if (NoticeInformationTypes.InsertCostume == informationType) { Costume costume = CompactPropertySerializer.Default.Deserialize <Costume>(info, 0); GlobalCache.InsertCostume(costume); } //服装信息更改 else if (NoticeInformationTypes.UpdateCostume == informationType) { Costume costume = CompactPropertySerializer.Default.Deserialize <Costume>(info, 0); GlobalCache.UpdateCostume(costume); } else if (NoticeInformationTypes.DeleteCostume == informationType) { string costumeID = Encoding.UTF8.GetString(info); GlobalCache.DeleteCostume(costumeID); } else if (NoticeInformationTypes.InsertCostumes == informationType) { List <Costume> costumes = CompactPropertySerializer.Default.Deserialize <List <Costume> >(info, 0); foreach (var costume in costumes) { GlobalCache.InsertCostume(costume); } } else if (NoticeInformationTypes.UpdateCostumes == informationType) { List <Costume> costumes = CompactPropertySerializer.Default.Deserialize <List <Costume> >(info, 0); foreach (var costume in costumes) { GlobalCache.UpdateCostume(costume); } } else if (NoticeInformationTypes.UpdateCostumeValid == informationType) { UpdateCostumeValidPara result = CompactPropertySerializer.Default.Deserialize <UpdateCostumeValidPara>(info, 0); GlobalCache.UpdateCostumeValid(result); } else if (NoticeInformationTypes.InsertCostumeStores == informationType) { GlobalCache.LoadCostumeInfos(); } #endregion #region 管理员信息更改 //新增管理员 else if (NoticeInformationTypes.InsertAdminUser == informationType) { AdminUser adminUser = CompactPropertySerializer.Default.Deserialize <AdminUser>(info, 0); GlobalCache.InsertAdminUser(adminUser); } //管理员信息更改 else if (NoticeInformationTypes.UpdateAdminUser == informationType) { AdminUser adminUser = CompactPropertySerializer.Default.Deserialize <AdminUser>(info, 0); GlobalCache.UpdateAdminUser(adminUser); } #endregion #region 供应商信息更改 //新增供应商 else if (NoticeInformationTypes.InsertSupplier == informationType) { Supplier supplier = CompactPropertySerializer.Default.Deserialize <Supplier>(info, 0); GlobalCache.InsertSupplier(supplier); } else if (NoticeInformationTypes.ImportSupplier == informationType) { List <Supplier> suppliers = CompactPropertySerializer.Default.Deserialize <List <Supplier> >(info, 0); if (suppliers != null) { foreach (var supplier in suppliers) { GlobalCache.InsertSupplier(supplier); } } } //供应商信息更改 else if (NoticeInformationTypes.UpdateSupplier == informationType) { Supplier supplier = CompactPropertySerializer.Default.Deserialize <Supplier>(info, 0); GlobalCache.UpdateSupplier(supplier); } //删除供应商 else if (NoticeInformationTypes.DeleteSupplier == informationType) { string supplierID = Encoding.UTF8.GetString(info); GlobalCache.DeleteSupplier(supplierID); } #endregion #region 店铺更改 //新增店铺 else if (NoticeInformationTypes.InsertShop == informationType) { Shop shop = CompactPropertySerializer.Default.Deserialize <Shop>(info, 0); GlobalCache.InsertShop(shop); } //店铺信息更改 else if (NoticeInformationTypes.UpdateShop == informationType) { Shop shop = CompactPropertySerializer.Default.Deserialize <Shop>(info, 0); GlobalCache.UpdateShop(shop); } else if (NoticeInformationTypes.DisableShop == informationType) { String shopID = Encoding.UTF8.GetString(info); GlobalCache.DisableShop(shopID); } else if (NoticeInformationTypes.DeleteShop == informationType) { String shopID = Encoding.UTF8.GetString(info); GlobalCache.RemoveShop(shopID); } //Todo: #endregion else if (NoticeInformationTypes.InsertDifferenceOrder == informationType) { int result = SerializeHelper.ByteArrayToInt(info); DifferenceOrderPagePara checkOrderPagePara = new DifferenceOrderPagePara() { OrderID = null, CostumeID = null, IsOpenDate = true, IsOnlyGetOut = true, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 1000, ShopID = CommonGlobalCache.CurrentShopID, OrderPrefixType = ValidateUtil.CheckEmptyValue(OrderPrefix.AllocateOrder), DifferenceOrderConfirmed = DifferenceOrderConfirmed.False, }; DifferenceOrderPage checkOrderListPage = CommonGlobalCache.ServerProxy.GetDifferenceOrderPage(checkOrderPagePara); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + checkOrderListPage.DifferenceOrderList.Count + "张差异单待处理,请及时处理!" + "#" + informationType); } #region 新的补货申请单待处理通知 else if (NoticeInformationTypes.ReplenishOutbound == informationType) { ReplenishCostumePagePara pageParaReplenish = new ReplenishCostumePagePara() { CostumeID = null, ReplenishOrderID = null, IsOpenDate = true, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 10000, ShopID = CommonGlobalCache.CurrentShopID, ReplenishOrderState = ReplenishOrderState.NotProcessing, BrandID = -1 }; ReplenishCostumePage listPageReplenish = CommonGlobalCache.ServerProxy.GetReplenishCostumePage(pageParaReplenish); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + listPageReplenish.ReplenishOrderList.Count + "张待发货的补货申请单待处理,请及时处理!" + "#" + informationType); } else if (NoticeInformationTypes.AllocateOutbound == informationType) { int result = SerializeHelper.ByteArrayToInt(info); if (GlobalCache.GetParameter(ParameterConfigKey.AllocateInDirectly)?.ParaValue == "1") { ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有新的调拨单已入库!"); } else { GetAllocateOrdersPara pagePara = new GetAllocateOrdersPara() { AllocateOrderID = null, AllocateOrderState = AllocateOrderState.Normal, CostumeID = null, EndDate = new CJBasic.Date(DateTime.Now), StartDate = new CJBasic.Date("1900-01-01"), ShopID = "", Type = AllocateOrderType.All, PageIndex = 0, PageSize = 20, ReceiptState = ReceiptState.WaitReceipt, LockShop = PermissonUtil.HasPermission(RolePermissionMenuEnum.调拨单查询, RolePermissionEnum.查看_只看本店), DestShopID = CommonGlobalCache.CurrentShopID, SourceShopID = "", }; InteractResult <AllocateOrderPage> listPage = CommonGlobalCache.ServerProxy.GetAllocateOrders(pagePara); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + listPage.Data.AllocateOrderList.Count + "张调拨单待处理,请及时处理!" + "#" + informationType); } } else if (NoticeInformationTypes.ReplenishCostume == informationType) { int result = SerializeHelper.ByteArrayToInt(info); ReplenishCostumePagePara pageParaReplenish = new ReplenishCostumePagePara() { CostumeID = null, ReplenishOrderID = null, IsOpenDate = true, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 10000, ShopID = CommonGlobalCache.CurrentShopID, ReplenishOrderState = ReplenishOrderState.NotProcessing, BrandID = -1 }; ReplenishCostumePage listPageReplenish = CommonGlobalCache.ServerProxy.GetReplenishCostumePage(pageParaReplenish); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有补货申请单待处理,请及时处理!" + "#" + informationType); } #endregion #region 盘点已审核通知 else if (NoticeInformationTypes.CheckStorePass == informationType) { GlobalUtil.WriteLog("盘点已审核通知"); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单已审核,请及时查收!" + "#" + informationType); // GlobalUtil.MainForm.OnStoreStateChanged(false); } #endregion #region 盘点退回通知 /* else if (NoticeInformationTypes.CancelCheckStore == informationType) * { * GlobalUtil.WriteLog("盘点退回通知"); * ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单被退回,请及时查收!" + "#" + informationType); * * } */ #endregion #region 补货申请单/调拨单冲单通知 else if (NoticeInformationTypes.OverrideOrder == informationType) { string result = String.Empty; if (info != null) { result = Encoding.UTF8.GetString(info); } GlobalUtil.WriteLog("补货申请单/或调拨单" + result + "冲单通知"); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的" + GlobalUtil.OrderType(result) + "单" + result + "被冲单,请及时查收!" + "#" + informationType); } #endregion #region 补货申请单取消 else if (NoticeInformationTypes.CancelReplenish == informationType) { string result = String.Empty; if (info != null) { result = Encoding.UTF8.GetString(info); } GlobalUtil.WriteLog("补货申请单" + result + "取消通知"); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的" + GlobalUtil.OrderType(result) + "单" + result + "被取消,请及时查收!" + "#" + informationType); } #endregion else if (NoticeInformationTypes.NewEmRefundOrder == informationType) { int result = SerializeHelper.ByteArrayToInt(info); GetEmOrderPagePara EmReturnpagePara = new GetEmOrderPagePara() { OrderID = null, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 1000, MemberPhoneOrName = null, CostumeIDOrName = null, OrderState = EmRetailOrderState.All, RefundStatus = RefundStatus.Refunding, }; EmOrderPage EmReturnlistPage = CommonGlobalCache.ServerProxy.GetEmOrderPage(EmReturnpagePara); int rows = EmReturnlistPage.ResultList.FindAll(t => t.RefundStateName == EmRetailOrder.GetRefundState(RefundStateEnum.RefundApplication) || t.RefundStateName == EmRetailOrder.GetRefundState(RefundStateEnum.Refunding)).Count; ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + rows + "张线上退货待处理,请及时处理!" + "#" + informationType); } else if (NoticeInformationTypes.NewEmRetailOrder == informationType) { int result = SerializeHelper.ByteArrayToInt(info); GetEmOrderPagePara EmpagePara = new GetEmOrderPagePara() { OrderID = null, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 1000, MemberPhoneOrName = null, CostumeIDOrName = null, OrderState = EmRetailOrderState.WaitDelivery, RefundStatus = RefundStatus.NotSelect, }; EmOrderPage EmlistPage = CommonGlobalCache.ServerProxy.GetEmOrderPage(EmpagePara); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + EmlistPage.ResultList.Count + "张线上订单待处理,请及时处理!" + "#" + informationType); } #region 批发客户信息更改 //新增供应商 else if (NoticeInformationTypes.InsertPfCustomer == informationType) { PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0); PfCustomerCache.InsertPfCustomer(supplier); } else if (NoticeInformationTypes.ImportPfCustomer == informationType) { List <PfCustomer> suppliers = CompactPropertySerializer.Default.Deserialize <List <PfCustomer> >(info, 0); foreach (var supplier in suppliers) { PfCustomerCache.InsertPfCustomer(supplier); } } //供应商信息更改 else if (NoticeInformationTypes.UpdatePfCustomer == informationType) { PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0); PfCustomerCache.UpdatePfCustomer(supplier); } //删除供应商 else if (NoticeInformationTypes.DeletePfCustomer == informationType) { string supplierID = Encoding.UTF8.GetString(info); PfCustomerCache.DeletePfCustomer(supplierID); } #endregion #region 盘点待处理通知 else if (NoticeInformationTypes.InsertCheckStore == informationType) { GlobalUtil.WriteLog("盘点待处理通知"); CheckStoreOrderPagePara checkPagePara = new CheckStoreOrderPagePara() { CheckStoreOrderID = null, IsOpenDate = true, StartDate = new CJBasic.Date("1900-01-01"), EndDate = new CJBasic.Date(DateTime.Now), PageIndex = 0, PageSize = 1000, //ShopID = CommonGlobalCache.CurrentShopID, CostumeID = null, State = CheckStoreOrderState.PendingReview, }; CheckStoreOrderPage ChecklistPage = CommonGlobalCache.ServerProxy.GetCheckStoreOrderPage(checkPagePara); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + ChecklistPage.CheckStoreOrderList.Count + "张盘点单待审核,请及时处理!" + "#" + informationType); } #endregion #region 盘点退回通知 else if (NoticeInformationTypes.CancelCheckStore == informationType) { GlobalUtil.WriteLog("盘点退回通知"); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单被退回,请及时处理!" + "#" + informationType); } #endregion #region 盘点取消通知 else if (NoticeInformationTypes.CancelCheckStoreTask == informationType) { GlobalUtil.WriteLog("盘点取消通知"); ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有盘点已取消!"); } #endregion else if (NoticeInformationTypes.EnabledSizeGroup == informationType) { EnabledSizeGroupPara sizeGroup = CompactPropertySerializer.Default.Deserialize <EnabledSizeGroupPara>(info, 0); GlobalCache.EnabledSizeGroup(sizeGroup); } else if (NoticeInformationTypes.InsertSizeGroup == informationType) { SizeGroup sizeGroup = CompactPropertySerializer.Default.Deserialize <SizeGroup>(info, 0); GlobalCache.InsertSizeGroup(sizeGroup); } else if (NoticeInformationTypes.UpdateSizeGroup == informationType) { SizeGroup sizeGroup = CompactPropertySerializer.Default.Deserialize <SizeGroup>(info, 0); GlobalCache.UpdateSizeGroup(sizeGroup); } else if (NoticeInformationTypes.DeleteSizeGroup == informationType) { String SizeGroupName = Encoding.UTF8.GetString(info); GlobalCache.DeleteSizeGroup(SizeGroupName); } else if (NoticeInformationTypes.UpdateSizeNames == informationType) { UpdateSizeNamesInfo sizeNameInfo = CompactPropertySerializer.Default.Deserialize <UpdateSizeNamesInfo>(info, 0); GlobalCache.UpdateSizeNames(sizeNameInfo); } else if (NoticeInformationTypes.InsertDistributor == informationType) { Distributor supplier = CompactPropertySerializer.Default.Deserialize <Distributor>(info, 0); GlobalCache.InsertDistributor(supplier); } else if (NoticeInformationTypes.UpdateDistributor == informationType) { Distributor supplier = CompactPropertySerializer.Default.Deserialize <Distributor>(info, 0); GlobalCache.UpdateDistributor(supplier); } #region 批发客户信息更改 //新增供应商 else if (NoticeInformationTypes.InsertPfCustomer == informationType) { PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0); PfCustomerCache.InsertPfCustomer(supplier); } //供应商信息更改 else if (NoticeInformationTypes.UpdatePfCustomer == informationType) { PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0); PfCustomerCache.UpdatePfCustomer(supplier); } //删除供应商 else if (NoticeInformationTypes.DeletePfCustomer == informationType) { string supplierID = Encoding.UTF8.GetString(info); PfCustomerCache.DeletePfCustomer(supplierID); } else if (NoticeInformationTypes.SendAnnounce == informationType) { int result = SerializeHelper.ByteArrayToInt(info); Announce announce = CompactPropertySerializer.Default.Deserialize <Announce>(info, 0); //1:发布中,2:已完成,3:已取消 AnnounceState state = (AnnounceState)announce.State; switch (state) { case AnnounceState.Finished: case AnnounceState.Cancel: ((MainForm)GlobalUtil.MainForm).SendAnnounce(state); break; case AnnounceState.Releasing: CommonGlobalCache.SystemUpdateMessage = announce.AnnounceContent; ((MainForm)GlobalUtil.MainForm).OnNewInfomation("系统升级公告\r\n尊敬的客户:\r\n" + announce.AnnounceContent); ((MainForm)GlobalUtil.MainForm).SendAnnounce(state); break; default: break; } } else if (NoticeInformationTypes.NoticeClose == informationType) { ((MainForm)GlobalUtil.MainForm).DoClose(); // System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location); } #endregion }
public static List <ColumnSetting> GetColumnSettings(DataGridView gridView, List <DataGridViewColumn> NotShowColumns) { //获取尺码设置信息 List <ColumnSetting> listItems = new List <ColumnSetting>(); foreach (DataGridViewColumn item in gridView.Columns) { //如果有显示,如果这个列表这个列是有显示的话,那么加入这个列中 DataGridViewColumn columnNotShow = NotShowColumns?.Find(t => t == item); if (curControl != null && curControl.ToString() == "JGNet.Common.CustomerInventorySearchCtrl" && !(item is DataGridViewCheckBoxColumn || item is DataGridViewImageColumn)) { bool isHasCostomerID = false; Control.ControlCollection sonControls = curControl.Controls; //遍历所有控件 foreach (Control control in sonControls) { if (control.Name == "skinPanel1") { Control.ControlCollection childSonControls = control.Controls; foreach (Control childcontrol in childSonControls) { if (childcontrol.Name == "skinTextBox_costumeID") { CostumeTextBox c = (CostumeTextBox)childcontrol; if (c.SkinTxt.Text != "") { isHasCostomerID = true; break; } } } if (isHasCostomerID) { break; } } else { continue; } // listBox1.Items.Add(control.Name); } if (isHasCostomerID) { if (item.HeaderText != "款号" && item.HeaderText != "商品名称" && item.HeaderText != "颜色" && item.HeaderText != "尺码") { continue; } } else { if (item.HeaderText != "客户" && item.HeaderText != "发货" && item.HeaderText != "销售" && item.HeaderText != "库存") { continue; } } listItems.Add(new ColumnSetting() { HeaderIndex = item.Index, HeaderID = item.DataPropertyName, HeaderText = item.HeaderText, Visible = item.Visible, Width = item.Width, ColWidth = item.Width, Enabled = (columnNotShow == null) }); } else if (!(item is DataGridViewLinkColumn || item is DataGridViewCheckBoxColumn || item is DataGridViewImageColumn)) { if (item.HeaderText == EnumHelper.GetDescription(RolePermissionEnum.查看_品牌)) { if (!PermissonUtil.HasPermission(RolePermissionMenuEnum.限, RolePermissionEnum.查看_品牌)) { continue; } } else if (item.HeaderText == EnumHelper.GetDescription(RolePermissionEnum.查看_成本价)) { if (!PermissonUtil.HasPermission(RolePermissionMenuEnum.限, RolePermissionEnum.查看_成本价)) { continue; } } else if (!PermissonUtil.HasPermission(RolePermissionMenuEnum.畅滞排行榜, RolePermissionEnum.查看_备注)) { if (item.HeaderText == EnumHelper.GetDescription(RolePermissionEnum.查看_备注)) { continue; } } //if (curControl is CostumeRetailAnalysisCtrl && item.Name.Contains("TypeValue")) //{ // continue; //} listItems.Add(new ColumnSetting() { HeaderIndex = item.Index, HeaderID = item.DataPropertyName, HeaderText = item.HeaderText, Visible = item.Visible, Width = item.Width, ColWidth = item.Width, Enabled = (columnNotShow == null) }); } } return(listItems); }