//获取系统信息(会员类型,区域,商品类型) public static void RequestSysInfo(DataResultBlock result) { SysManage.Manage().RequestSysEvent += result; SysManage.Manage().GetAreaList(); SysManage.Manage().GetProductTypes(); SysManage.Manage().GetMemberLvList(); SysManage.Manage().GetManagerList(); SysManage.Manage().GetStaffList(); }
//更新管理员数据(管理员管理界面使用) public static void UpdateManagerData(IList <StructRole> temmanagers) { SysManage.Manage().managers.Clear(); SysManage.Manage().managerDict.Clear(); foreach (StructRole role in temmanagers) { SysManage.Manage().managerDict.Add(role.Roleid, role); SysManage.Manage().managers.Add(role); } }
//更新员工数据(修改短信推送,修改员工信息) public static void UpdateStaffData(IList <StructAccount> tem) { SysManage.Manage().staffs.Clear(); SysManage.Manage().staffDict.Clear(); foreach (StructAccount staff in tem) { SysManage.Manage().staffDict.Add(staff.Guid, staff); SysManage.Manage().staffs.Add(staff); } }
//更新商品类别 public static void UpdateProductData(IList <StructDictItem> newProductTypes) { SysManage.Manage().productTypes.Clear(); SysManage.Manage().productDict.Clear(); foreach (StructDictItem item in newProductTypes) { ProductTypeModel model = new ProductTypeModel(item); SysManage.Manage().productTypes.Add(model); SysManage.Manage().productDict.Add(item.Code, model); } }
// 更新区域数据 public static void UpdateAreaData(IList <StructDictItem> items) { SysManage.Manage().areas.Clear(); SysManage.Manage().areaDict.Clear(); foreach (StructDictItem item in items) { AreaTypeModel model = new AreaTypeModel(item); SysManage.Manage().areaDict.Add(item.Code.ToString(), model); SysManage.Manage().areas.Add(model); } }
//更新会员数据(会员等级设定使用) public static void UpdateMemberTypeData(IList <StructDictItem> newMemberTypes) { SysManage.Manage().memberTypes.Clear(); SysManage.Manage().memberDict.Clear(); foreach (StructDictItem item in newMemberTypes) { MemberTypeModel model = new MemberTypeModel(item); SysManage.Manage().memberDict.Add(item.Code, model); SysManage.Manage().memberTypes.Add(model); } }
//获取员工姓名 public static string GetStaffName(string id) { StructAccount staff; SysManage.Manage().staffDict.TryGetValue(id, out staff); if (staff == null) { return("该员工已移除"); } else { return(staff.Nickname); } }
//获取管理员名称 public static string GetManagerName(string id) { StructRole role; SysManage.Manage().managerDict.TryGetValue(id, out role); if (role == null) { return("该管理员角色已移除"); } else { return(role.Name); } }
//获取区域名称 public static string GetAreaName(string code) { AreaTypeModel item = null; SysManage.Manage().areaDict.TryGetValue(code, out item); if (item == null) { return("未标注区域"); } else { return(item.areaName); } }
// 获取产品类型名称 public static string GetProductTypeName(int code) { ProductTypeModel item; SysManage.Manage().productDict.TryGetValue(code, out item); if (item == null) { return("该类型已移除"); } else { return(item.typeName); } }
//获取会员类型名称 public static string GetMemberTypeName(string temId) { try { int id = int.Parse(temId); MemberTypeModel model; SysManage.Manage().memberDict.TryGetValue(id, out model); if (model == null) { return("该会员等级已移除"); } else { return(model.typeName); } } catch (Exception exc) { return(""); } }
public static void RemoveRequestSysInfo(DataResultBlock result) { SysManage.Manage().RequestSysEvent -= result; }