Exemplo n.º 1
0
 public static bool ValidateCustomerPhone(string cellNumber, string confimKey, Point point)
 {
     using (var tran = TransactionManager.Create())
     {
         if (CustomerDA.ValidateCustomerPhone(cellNumber, confimKey) == false)
         {
             return(false);
         }
         PointFilter filter = new PointFilter
         {
             CustomerSysNo    = point.CustomerSysNo,
             ObtainType       = point.ObtainType,
             LanguageCode     = ConstValue.LanguageCode,
             CompanyCode      = ConstValue.CompanyCode,
             CurrencyCode     = ConstValue.CurrencySysNo.ToString(),
             StoreCompanyCode = ConstValue.StoreCompanyCode
         };
         if (CommonDA.ExistsPoint(filter) <= 0)
         {
             CommonFacade.AddPoint(point);
         }
         tran.Complete();
         return(true);
     }
 }
Exemplo n.º 2
0
        protected async static Task <bool> LoadAnalogPointsFromServer()
        {
            _allAnalogPoints = new SortedList <string, EDSPointInfo>();
            try {
                if (!EDSClass.Connected)
                {
                    EDSClass.Connect();
                }
                PointFilter      filter = new PointFilter();
                List <PointType> types  = new List <PointType>();
                types.Add(PointType.POINTTYPEANALOG);
                types.Add(PointType.POINTTYPEPACKED);
                types.Add(PointType.POINTTYPEDOUBLE);
                types.Add(PointType.POINTTYPEINT64);
                filter.rt = types.ToArray();



                bool             finish = false;
                uint             index  = 0;
                getPointsRequest req    = new getPointsRequest();
                req.authString = EDSClass.AuthStr;
                req.filter     = filter;
                req.order      = "";

                EDSClass.Single.GlobalInfo  = "Получение списка точек";
                EDSClass.Single.Ready       = false;
                EDSClass.Single.ProcessCalc = true;
                uint match = 0;
                while (!finish)
                {
                    req.maxCount = 1000;
                    req.startIdx = index;
                    EDSClass.Single.ProcessInfo = String.Format("Точки {0} - {1} из {2}", req.startIdx, req.startIdx + req.maxCount, (match == 0 ? "?" : match.ToString()));
                    getPointsResponse resp = await EDSClass.Client.getPointsAsync(req);

                    //Point[] points = EDSClass.Client.getPoints(EDSClass.AuthStr, filter, "", index, 1000, out cnt, out total);
                    foreach (Point point in resp.points)
                    {
                        try {
                            string tg = string.Join(";", point.tg);
                            _allAnalogPoints.Add(point.id.iess, new EDSPointInfo(point.id.iess, point.desc, tg));
                        } catch { }
                    }
                    index += (uint)resp.points.Count();
                    finish = index >= resp.matchCount;
                    match  = resp.matchCount;
                }
            } catch (Exception e) {
                Logger.Info(("Ошибка при получении списка точек: " + e.ToString()));
            } finally {
                EDSClass.Single.Ready       = true;
                EDSClass.Single.ProcessCalc = false;
            }
            return(true);
        }
Exemplo n.º 3
0
        public static int ExistsPoint(PointFilter filter)
        {
            var cmd = DataCommandManager.GetDataCommand("ExistsPoint");

            cmd.SetParameterValue("@CustomerSysNo", filter.CustomerSysNo);
            cmd.SetParameterValue("@ObtainType", filter.ObtainType);
            cmd.SetParameterValue("@LanguageCode", filter.LanguageCode);
            cmd.SetParameterValue("@CurrencyCode", filter.CurrencyCode);
            cmd.SetParameterValue("@CompanyCode", filter.CompanyCode);
            cmd.SetParameterValue("@StoreCompanyCode", filter.StoreCompanyCode);
            return(cmd.ExecuteDataTable().Rows.Count);
        }
Exemplo n.º 4
0
        public PointItems GetPointItems(int userId, int contextOrganizationId, PointFilter filter)
        {
            var parameters = new
            {
                userId,
                contextOrganizationId,
                filter.EntityStateIds,
                filter.Search,
                filter.Skip,
                filter.Take
            };

            return(ExecuteMultiResultSetSp <PointItems>("[race].[spGetPointItems]", parameters));
        }
Exemplo n.º 5
0
 /// <summary>
 /// 用户邮箱地址通过验证
 /// </summary>
 /// <param name="sysno"></param>
 /// <returns></returns>
 public static bool CustomerEmailValidated(int sysno, Point point)
 {
     using (var tran = TransactionManager.Create())
     {
         CustomerDA.CustomerEmailValidated(sysno);
         PointFilter filter = new PointFilter
         {
             CustomerSysNo    = point.CustomerSysNo,
             ObtainType       = point.ObtainType,
             LanguageCode     = ConstValue.LanguageCode,
             CompanyCode      = ConstValue.CompanyCode,
             CurrencyCode     = ConstValue.CurrencySysNo.ToString(),
             StoreCompanyCode = ConstValue.StoreCompanyCode
         };
         if (CommonDA.ExistsPoint(filter) <= 0)
         {
             CommonFacade.AddPoint(point);
         }
         tran.Complete();
         return(true);
     }
     return(false);
 }