Exemplo n.º 1
0
 public static IEnumerable <FilialeInfo> GetAllFiliale()
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var items = client.Instance.GetAllFiliale();
         foreach (var item in items)
         {
             if (item.IsActive)
             {
                 yield return new FilialeInfo
                        {
                            Address      = item.Address,
                            Code         = item.Code,
                            ID           = item.ID,
                            IsActive     = item.IsActive,
                            ParentId     = item.ParentId,
                            Name         = item.Name,
                            Rank         = item.Rank,
                            FilialeTypes = item.FilialeTypes,
                            ShopJoinType = item.ShopJoinType,
                            GoodsTypes   = item.GoodsTypes
                        }
             }
             ;
         }
     }
 }
Exemplo n.º 2
0
 public static bool VerifyIsAllowVisitPage(Guid personnelId, Guid systemId, string pageUrl)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.VerifyPageIsVisitPermission(personnelId, systemId, pageUrl));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 获取所有职位
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <SystemPositionInfo> GetAllSystemPositionList()
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.GetSystemBranchPosition().OrderBy(w => w.OrderIndex).ToList());
     }
 }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="filialeiId"></param>
 /// <param name="systemBranchId"></param>
 /// <returns></returns>
 public static IList <LoginAccountInfo> GetLoginAccountListBySystemBranchId(Guid filialeiId, Guid systemBranchId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.GetLoginAccountListBySystemBranchId(filialeiId, systemBranchId));
     }
 }
Exemplo n.º 5
0
 public IList <PersonnelInfo> GetAccountInfoByRealName(string realName)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var info = client.Instance.GetAccountInfoByRealName(realName);
         List <PersonnelInfo> personnel = new List <PersonnelInfo>();
         foreach (var loginAccountInfo in info)
         {
             personnel.Add(new PersonnelInfo
             {
                 PersonnelId           = loginAccountInfo.PersonnelId,
                 RealName              = loginAccountInfo.RealName,
                 AccountNo             = loginAccountInfo.AccountNo,
                 EnterpriseNo          = loginAccountInfo.AccountNo,
                 IsActive              = loginAccountInfo.IsActive,
                 SystemBrandPositionId = loginAccountInfo.SystemBranchPositionID,
                 FilialeId             = loginAccountInfo.PositionInfo != null ? loginAccountInfo.PositionInfo.FilialeId : Guid.Empty,
                 BranchId              = loginAccountInfo.PositionInfo != null ? loginAccountInfo.PositionInfo.BranchId : Guid.Empty,
                 PositionId            = loginAccountInfo.PositionInfo != null ? loginAccountInfo.PositionInfo.ID : Guid.Empty,
                 CurrentFilialeId      = Guid.Empty
             });
         }
         return(personnel);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 获取所有部门集合
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <BranchInfo> GetAllBranch()
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.GetAllFilialeBranch().OrderBy(w => w.OrderIndex).ToList());
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 读取公司信息
 /// </summary>
 /// <returns></returns>
 private static IEnumerable <FilialeInfo> GetAllMisFiliales()
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var items = client.Instance.GetAllFiliale();
         if (items != null && items.Any())
         {
             foreach (var item in items.OrderBy(w => w.OrderIndex))
             {
                 if (item.IsActive)
                 {
                     yield return(new FilialeInfo
                     {
                         ID = item.ID,
                         Address = item.Address,
                         Code = item.Code,
                         Description = item.Description,
                         Name = item.Name,
                         RealName = item.RealName,
                         ParentId = item.ParentId,
                         Rank = item.Rank,
                         ShopJoinType = item.ShopJoinType,
                         TaxNumber = item.TaxNumber,
                         RegisterAddress = item.RegisterAddress,
                         IsActive = item.IsActive,
                         FilialeTypes = item.FilialeTypes,
                         GoodsTypes = item.GoodsTypes,
                         IsSaleFiliale = item.IsSaleFiliale
                     });
                 }
             }
         }
     }
 }
Exemplo n.º 8
0
 public static LoginAccountInfo GetAccountInfoByPersonnelId(Guid personnelId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.GetAccountInfoByPersonnelId(personnelId));
     }
 }
Exemplo n.º 9
0
 public static IList <MenuInfo> GetMenuList(Guid systemId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         return(client.Instance.GetMenuList(systemId).OrderBy(w => w.OrderIndex).ToList());
     }
 }
Exemplo n.º 10
0
 public static bool VerifyIsAllowPageOperation(Guid personnelId, Guid systemId, string pageUrl, string pointCode)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         //return true;
         return(client.Instance.VerifyPageOperationIsVisitPermission(personnelId, systemId, pageUrl, pointCode));
     }
 }
Exemplo n.º 11
0
 public PersonnelInfo Get(string accountNo)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var info = client.Instance.GetAccountInfo(accountNo);
         return(new PersonnelInfo(info));
     }
 }
Exemplo n.º 12
0
 public PersonnelInfo Get(Guid personnelId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var info = client.Instance.GetAccountInfoByPersonnelId(personnelId);
         return(new PersonnelInfo(info));
     }
 }
Exemplo n.º 13
0
        public IList <PersonnelInfo> GetList()
        {
            var list = new List <PersonnelInfo>();

            using (var client = ClientProxy.CreateMISWcfClient())
            {
                var items = client.Instance.GetAllLoginAccount();
                list.AddRange(items.Select(item => new PersonnelInfo(item))
                              .Where(personnelInfo => personnelInfo.PersonnelId != Guid.Empty && personnelInfo.IsActive));
            }
            return(list);
        }
Exemplo n.º 14
0
 static Guid GetFilialeIdBySalePlatform(Guid targetId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var salePlatformInfo = client.Instance.GetSalePlatformInfo(targetId);
         if (salePlatformInfo != null && salePlatformInfo.ID != Guid.Empty)
         {
             return(salePlatformInfo.FilialeId);
         }
         return(targetId);
     }
 }
Exemplo n.º 15
0
 public string GetName(Guid personnelId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var info = client.Instance.GetAccountInfoByPersonnelId(personnelId);
         if (info != null)
         {
             return(info.RealName);
         }
         return(string.Empty);
     }
 }
Exemplo n.º 16
0
 public static Model.LoginResultInfo VerifyLoginToken(string token)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var info = client.Instance.VerifyLoginToken(token);
         if (info == null)
         {
             return(new Model.LoginResultInfo(new MIS.Model.View.LoginResultInfo("登录口令验证通信失败")));
         }
         return(new Model.LoginResultInfo(info));
     }
 }
Exemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="filialeId"></param>
        /// <param name="branchId"></param>
        /// <returns></returns>
        public IEnumerable <PersonnelInfo> GetList(Guid filialeId, Guid branchId)
        {
            var list = new List <PersonnelInfo>();

            using (var client = ClientProxy.CreateMISWcfClient())
            {
                var items = client.Instance.GetAllLoginAccount();
                list.AddRange(items.Select(item => new PersonnelInfo(item))
                              .Where(personnelInfo => personnelInfo.PersonnelId != Guid.Empty && personnelInfo.IsActive &&
                                     personnelInfo.FilialeId == filialeId && personnelInfo.BranchId == branchId));
            }
            return(list);
        }
Exemplo n.º 18
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="personnelIds"></param>
 /// <returns></returns>
 public static Dictionary <Guid, Guid> GetBranchIdsByPersonnelIds(IList <Guid> personnelIds)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var result = client.Instance.GetAccountsByPersonnelIds(personnelIds);
         if (result != null)
         {
             result = result.Where(p => p != null && p.PositionInfo != null && (!p.PositionInfo.BranchId.Equals(Guid.Empty))).ToList();
             return(result.ToDictionary(k => k.PersonnelId, v => v.PositionInfo.BranchId));
         }
         return(new Dictionary <Guid, Guid>());
     }
 }
Exemplo n.º 19
0
 /// <summary>
 /// 获取所有销售平台集合
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <SalePlatformInfo> GetAllSalePlatform()
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var items = client.Instance.GetAllSalePlatform().ToList();
         foreach (var item in items)
         {
             yield return(new SalePlatformInfo
             {
                 FilialeId = item.FilialeId,
                 ID = item.ID,
                 IsActive = item.IsActive,
                 Name = item.Name,
                 Url = item.Url,
                 ExternalName = item.ExternalName,
                 AccountCheckingType = item.AccountCheckingType
             });
         }
     }
 }
Exemplo n.º 20
0
 public static FilialeInfo GetFiliaeInfo(Guid filialeId)
 {
     using (var client = ClientProxy.CreateMISWcfClient())
     {
         var item = client.Instance.GetFilialeInfo(filialeId);
         return(new FilialeInfo
         {
             Address = item.Address,
             Code = item.Code,
             ID = item.ID,
             IsActive = item.IsActive,
             ParentId = item.ParentId,
             Name = item.Name,
             Rank = item.Rank,
             FilialeTypes = item.FilialeTypes,
             ShopJoinType = item.ShopJoinType,
             GoodsTypes = item.GoodsTypes
         });
     }
 }