コード例 #1
0
ファイル: PdaService.cs プロジェクト: songfang/Wms
 public ResResultModel GetLogisticsDistributionByOrdercode(string OrderCode)
 {
     try
     {
         var bll       = new LogisticsDistribution();
         var modelInfo = bll.GetModel(OrderCode);
         return(ResResult.Response(true, "", JsonConvert.SerializeObject(modelInfo)));
     }
     catch (Exception ex)
     {
         return(ResResult.Response(false, ex.Message, ""));
     }
 }
コード例 #2
0
ファイル: PdaService.cs プロジェクト: songfang/Wms
        public ResResultModel SaveLogisticsDistribution(PdaLogisticsDistributionModel model)
        {
            try
            {
                new CustomException("SaveLogisticsDistribution--" + JsonConvert.SerializeObject(model));

                if (string.IsNullOrWhiteSpace(model.OrderCode) || string.IsNullOrWhiteSpace(model.Status))
                {
                    throw new ArgumentException(MC.Request_Params_InvalidError);
                }
                var bll       = new LogisticsDistribution();
                var modelInfo = bll.GetModel(model.OrderCode);
                if (modelInfo == null)
                {
                    throw new ArgumentException(MC.Data_NotExist);
                }
                modelInfo.Status = model.Status;
                if (bll.Update(modelInfo) < 1)
                {
                    throw new ArgumentException(MC.M_Save_Error);
                }
                var ip      = HttpClientHelper.GetClientIp(HttpContext.Current);
                var om      = new OrderMap();
                var oldInfo = om.GetModel(model.OrderCode);
                if (oldInfo != null)
                {
                    var omInfo = new OrderMapInfo(oldInfo.UserId, oldInfo.OrderCode, model.Lnglat, ip, "", "", model.Platform, DateTime.Now);
                    om.Update(omInfo);
                }
                else
                {
                    var omInfo = new OrderMapInfo(Guid.Empty, model.OrderCode, model.Lnglat, ip, "", "", model.Platform, DateTime.Now);
                    om.Insert(omInfo);
                }

                return(ResResult.Response(true, MC.M_Save_Ok, ""));
            }
            catch (Exception ex)
            {
                return(ResResult.Response(false, ex.Message, ""));
            }
        }
コード例 #3
0
ファイル: HandlerUsers.ashx.cs プロジェクト: songfang/Wms
        private void GetLogisticsDistributionInfo(HttpContext context)
        {
            var Id = Guid.Empty;

            Guid.TryParse(context.Request.Form["Id"], out Id);
            if (Id.Equals(Guid.Empty))
            {
                context.Response.Write(ResResult.ResJsonString(false, MC.Request_Params_InvalidError, ""));
                return;
            }
            var bll     = new LogisticsDistribution();
            var oldInfo = bll.GetModel(Id);

            if (oldInfo == null)
            {
                context.Response.Write(ResResult.ResJsonString(false, MC.Data_NotExist, ""));
                return;
            }

            context.Response.Write(ResResult.ResJsonString(true, "", JsonConvert.SerializeObject(oldInfo)));
        }