/// <summary>
 /// 获得盘点盘差信息
 /// </summary>
 /// <param name="orderNum"></param>
 /// <param name="pageInfo"></param>
 /// <returns></returns>
 public List<CheckDataEntity> GetCheckDifList(string orderNum, ref PageInfo pageInfo)
 {
     CheckDataEntity entity = new CheckDataEntity();
     entity.IncludeAll();
     entity.Where(a => a.OrderNum == orderNum);
     entity.OrderBy(a => a.ID, EOrderBy.ASC);
     int rowCount = 0;
     List<CheckDataEntity> listResult = this.CheckData.GetList(entity,pageInfo.PageSize,pageInfo.PageIndex,out rowCount);
     pageInfo.PageCount = rowCount;
     return listResult;
 }
Beispiel #2
0
 public static CheckData_CE ToCE(CheckDataEntity item)
 {
     CheckData_CE target = new CheckData_CE();
     target.ID=item.ID;
     target.OrderNum=item.OrderNum;
     target.LocalNum=item.LocalNum;
     target.LocalName=item.LocalName;
     target.StorageNum=item.StorageNum;
     target.ProductNum=item.ProductNum;
     target.BarCode=item.BarCode;
     target.ProductName=item.ProductName;
     target.LocalQty=item.LocalQty;
     target.FirstQty=item.FirstQty;
     target.SecondQty=item.SecondQty;
     target.DifQty=item.DifQty;
     target.FirstUser=item.FirstUser;
     target.SecondUser=item.SecondUser;
     target.CreateTime=item.CreateTime;
     return target;
 }
        public ActionResult AddCheckData()
        {
            string OrderNum = WebUtil.GetFormValue<string>("OrderNum",string.Empty);
            string LocalNum = WebUtil.GetFormValue<string>("LocalNum", string.Empty);
            string LocalName = WebUtil.GetFormValue<string>("LocalName", string.Empty);
            string ProductNum = WebUtil.GetFormValue<string>("ProductNum", string.Empty);
            string BarCode = WebUtil.GetFormValue<string>("BarCode", string.Empty);
            string ProductName = WebUtil.GetFormValue<string>("ProductName", string.Empty);
            string BatchNum = WebUtil.GetFormValue<string>("BatchNum", string.Empty);
            double FirstQty = WebUtil.GetFormValue<double>("FirstQty", 0);
            string StorageNum = this.DefaultStore;
            string FirstUser = this.LoginUser.UserCode;

            CheckDataEntity entity = new CheckDataEntity();
            entity.OrderNum = OrderNum;
            entity.LocalNum = LocalNum;
            entity.LocalName = LocalName;
            entity.StorageNum = StorageNum;
            entity.ProductNum = ProductNum;
            entity.ProductName = ProductName;
            entity.BarCode = BarCode;
            entity.BatchNum = BatchNum;
            entity.LocalQty = 0;
            entity.FirstQty = FirstQty;
            entity.SecondQty = 0;
            entity.DifQty = 0;
            entity.FirstUser = FirstUser;
            entity.SecondUser = "";
            entity.CreateTime = DateTime.Now;

            CheckDataProvider provider = new CheckDataProvider();
            int line = provider.AddCheckData(entity);
            if (line > 0)
            {
                this.ReturnJson.AddProperty("Key", "1000");
            }
            return Content(this.ReturnJson.ToString());
        }
 public ActionResult CheckData()
 {
     CheckDataEntity entity = new CheckDataEntity();
     string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     string LocalNum = WebUtil.GetFormValue<string>("LocalNum", string.Empty);
     string ProductNum = WebUtil.GetFormValue<string>("ProductNum", string.Empty);
     string BarCode = WebUtil.GetFormValue<string>("BarCode", string.Empty);
     string BatchNum = WebUtil.GetFormValue<string>("BatchNum", string.Empty);
     string StorageNum = ResourceManager.GetSettingEntity("STORE_DEFAULT_PRODUCT").Value;
     string LocalName = WebUtil.GetFormValue<string>("LocalName", string.Empty);
     double Qty = WebUtil.GetFormValue<double>("Qty", 0);
     int ID = WebUtil.GetFormValue<int>("ID",0);
     entity.ID = ID;
     entity.OrderNum = OrderNum;
     entity.LocalNum = LocalNum;
     entity.LocalName = LocalName;
     entity.ProductNum = ProductNum;
     entity.BarCode = BarCode;
     entity.StorageNum = StorageNum;
     entity.FirstQty = Qty;
     entity.BatchNum = BatchNum;
     CheckDataProvider provider = new CheckDataProvider();
     int line = provider.UpdateCheckInfoNum(entity);
     if (line > 0)
     {
         this.ReturnJson.AddProperty("Key", "1000");
         this.ReturnJson.AddProperty("Value", "盘点单创建成功");
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult DeleteCheckData()
 {
     int id = WebUtil.GetFormValue<int>("id",0);
     CheckDataEntity entity = new CheckDataEntity();
     entity.Where(a => a.ID == id);
     CheckDataProvider provider = new CheckDataProvider();
     int line = provider.DeleteCheckData(entity);
     if (line > 0)
     {
         this.ReturnJson.AddProperty("Key", "1000");
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult CheckData()
 {
     string Url = WebUtil.GetFormValue<string>("Url", string.Empty);
     string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     DataSet dataset = ExcelHelper.LoadDataFromExcel(Server.MapPath(Url), "盘点管理$");
     if (dataset != null && dataset.Tables.Count > 0)
     {
         DataTable table = dataset.Tables[0];
         int index = 0;
         int line = 0;
         foreach (DataRow row in table.Rows)
         {
             if (index > 0)
             {
                 CheckDataEntity entity = new CheckDataEntity();
                 string LocalNum = row[1].ToString();
                 string ProductNum = row[2].ToString();
                 string BarCode = row[3].ToString();
                 string StorageNum = this.DefaultStore;
                 string BatchNum = row[5].ToString();
                 double Qty = ConvertHelper.ToType<double>(row[6].ToString(), 0);
                 entity.OrderNum = OrderNum;
                 entity.LocalNum = LocalNum;
                 entity.ProductNum = ProductNum;
                 entity.BarCode = BarCode;
                 entity.StorageNum = StorageNum;
                 entity.FirstQty = Qty;
                 entity.BatchNum = BatchNum;
                 CheckDataProvider provider = new CheckDataProvider();
                 line += provider.UpdateCheckInfoNum(entity);
             }
             index++;
         }
         if (line > 0)
         {
             this.ReturnJson.AddProperty("Key","1000");
             this.ReturnJson.AddProperty("Value", "提交数据成功");
         }
     }
     return Content(this.ReturnJson.ToString());
 }
 /// <summary>
 /// 获取盘点单据Excel数据
 /// </summary>
 /// <returns></returns>
 public List<CheckDataEntity> GetCheckOrder(string orderNum)
 {
     CheckDataEntity entity = new CheckDataEntity();
     entity.IncludeAll();
     entity.Where(a => a.OrderNum == orderNum);
     List<CheckDataEntity> listResult = this.CheckData.GetList(entity);
     return listResult;
 }
 /// <summary>
 /// 删除盘点数据
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int DeleteCheckData(CheckDataEntity entity)
 {
     int line = this.CheckData.Delete(entity);
     return line;
 }
 /// <summary>
 /// 新增盘点数据
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int AddCheckData(CheckDataEntity entity)
 {
     entity.IncludeAll();
     int line = this.CheckData.Add(entity);
     return line;
 }
 /// <summary>
 /// 修改盘点差异表中盘点的数据
 /// </summary>
 /// <returns></returns>
 public int UpdateCheckInfoNum(CheckDataEntity entity)
 {
     entity.IncludeFirstQty(true);
     entity.Where(a => a.OrderNum == entity.OrderNum)
         .And(a => a.LocalNum == entity.LocalNum)
         .And(a => a.StorageNum == entity.StorageNum)
         .And(a => a.ProductNum == entity.ProductNum)
         .And(a => a.BarCode == entity.BarCode)
         .And(a=>a.BatchNum==entity.BatchNum)
         ;
     int line = this.CheckData.Update(entity);
     return line;
 }