Example #1
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public ActionResult GetSingle()
        {
            string SnNum     = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID");

            CarrierProvider provider = new CarrierProvider(CompanyID);
            CarrierEntity   entity   = provider.GetSingle(SnNum);

            DataResult <CarrierEntity> dataResult = new DataResult <CarrierEntity>();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Result  = entity;
            dataResult.Message = "响应成功";

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Example #2
0
        /// <summary>
        /// 设置承运商
        /// </summary>
        /// <param name="SnNum"></param>
        /// <param name="CarrierNum"></param>
        /// <param name="LogisticsNo"></param>
        /// <returns></returns>
        public int SetCarrier(string SnNum, string CarrierNum, string LogisticsNo)
        {
            CarrierProvider provider = new CarrierProvider(this.CompanyID);

            OutStorageEntity entity = new OutStorageEntity();

            entity.CarrierNum = CarrierNum;
            CarrierEntity carrier = provider.GetSingle(CarrierNum);

            if (carrier != null)
            {
                entity.CarrierName = carrier.CarrierName;
            }
            entity.LogisticsNo = LogisticsNo;

            entity.Include(item => new { item.CarrierNum, item.CarrierName, item.LogisticsNo });
            entity.Where(item => item.SnNum == SnNum).And(item => item.CompanyID == this.CompanyID);
            int line = this.OutStorage.Update(entity);

            return(line);
        }