Пример #1
0
        /// <summary>
        /// 修改门店
        /// </summary>
        /// <param name="storeDTO">门店实体</param>
        public ResultDTO UpdateStoreExt(Jinher.AMP.BTP.Deploy.StoreDTO storeDTO)
        {
            try
            {
                StoreMgDTO storeMg = new StoreMgDTO();
                storeMg.FillWith(storeDTO);
                storeMg.Location = new double[] { (double)storeDTO.XAxis, (double)storeDTO.YAxis };
                WriteConcernResult wcResult = MongoCollections.Store.Save(storeMg);
                //var ub = Update.Set("Id",storeDTO.Id);
                //var storeQuery = Query<StoreMgDTO>.Where(c => c.Id == storeDTO.Id);
                //_collection.FindAndModify(storeQuery, SortBy.Null, ub);
                //_collection.Update(storeQuery,);
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("修改门店服务异常。storeDTO:{0}", JsonHelper.JsonSerializer(storeDTO)), ex);
                return(new ResultDTO {
                    ResultCode = 1, Message = "Error"
                });
            }



            return(new ResultDTO {
                ResultCode = 0, Message = "Success"
            });
        }
Пример #2
0
        /// <summary>
        /// 添加门店
        /// </summary>
        /// <param name="storeDTO">门店实体</param>
        public ResultDTO AddStoreExt(Jinher.AMP.BTP.Deploy.StoreDTO storeDTO)
        {
            ResultDTO result = new ResultDTO();

            try
            {
                StoreMgDTO smgDto = new StoreMgDTO();
                smgDto.FillWith(storeDTO);
                smgDto.Location = new double[] { (double)storeDTO.XAxis, (double)storeDTO.YAxis };
                MongoCollections.Store.Save(smgDto);
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("添加门店服务异常。storeDTO:{0}", JsonHelper.JsonSerializer(storeDTO)), ex);
                return(new ResultDTO {
                    ResultCode = 1, Message = "Error"
                });
            }

            return(new ResultDTO {
                ResultCode = 0, Message = "Success"
            });
        }
Пример #3
0
 /// <summary>
 /// 修改门店
 /// </summary>
 /// <param name="storeDTO">门店实体</param>
 public ResultDTO UpdateStore(Jinher.AMP.BTP.Deploy.StoreDTO storeDTO)
 {
     base.Do();
     return(this.Command.UpdateStore(storeDTO));
 }
Пример #4
0
 /// <summary>
 /// 添加门店
 /// </summary>
 /// <param name="storeDTO">门店实体</param>
 public ResultDTO AddStore(Jinher.AMP.BTP.Deploy.StoreDTO storeDTO)
 {
     base.Do();
     return(this.AddStoreExt(storeDTO));
 }