using AutoMapper; 
 | 
using System; 
 | 
using System.Collections.Generic; 
 | 
using System.Linq; 
 | 
using System.Text; 
 | 
using System.Threading.Tasks; 
 | 
using WIDESEAWCS_Core; 
 | 
using WIDESEAWCS_Core.BaseRepository; 
 | 
using WIDESEAWCS_Core.BaseServices; 
 | 
using WIDESEAWCS_ISystemServices; 
 | 
using WIDESEAWCS_Model.Models; 
 | 
  
 | 
namespace WIDESEAWCS_SystemServices 
 | 
{ 
 | 
    public class dt_outstockinfoService : ServiceBase<dt_outstockinfo, IRepository<dt_outstockinfo>>, Idt_OutstockinfoService 
 | 
    { 
 | 
        private readonly IMapper _mapper; 
 | 
        /// <summary> 
 | 
        /// 仓储层(数据库访问) 
 | 
        /// </summary> 
 | 
        public IRepository<dt_outstockinfo> Repository => BaseDal; 
 | 
        public dt_outstockinfoService(IRepository<dt_outstockinfo> BaseDal, IMapper mapper) : base(BaseDal) 
 | 
        { 
 | 
            _mapper = mapper; 
 | 
        } 
 | 
  
 | 
        /// <summary> 
 | 
        /// 修改出库物料信息,需要出外购还是自产 
 | 
        /// </summary> 
 | 
        /// <param name="batch"></param> 
 | 
        /// <returns></returns> 
 | 
        public WebResponseContent UpdateIsOutStock(int isout) 
 | 
        { 
 | 
            WebResponseContent content = new WebResponseContent(); 
 | 
            try 
 | 
            { 
 | 
                var isoutstock = BaseDal.QueryFirst(v => v.Id == 1); 
 | 
                isoutstock.isout = isout; 
 | 
                BaseDal.UpdateData(isoutstock); 
 | 
  
 | 
                content = WebResponseContent.Instance.OK(); 
 | 
            } 
 | 
            catch (Exception ex) 
 | 
            { 
 | 
                content = WebResponseContent.Instance.Error($"修改入库批次号失败:【{ex.Message}】"); 
 | 
            } 
 | 
            return content; 
 | 
        } 
 | 
  
 | 
        public WebResponseContent UpdateInOut(int isout) 
 | 
        { 
 | 
            WebResponseContent content = new WebResponseContent(); 
 | 
            try 
 | 
            { 
 | 
                var isoutstock = BaseDal.QueryFirst(v => v.Id == 1); 
 | 
                isoutstock.InOut = isout; 
 | 
                BaseDal.UpdateData(isoutstock); 
 | 
  
 | 
                content = WebResponseContent.Instance.OK(); 
 | 
            } 
 | 
            catch (Exception ex) 
 | 
            { 
 | 
                content = WebResponseContent.Instance.Error($"修改直接出库还是正常出库失败:【{ex.Message}】"); 
 | 
            } 
 | 
            return content; 
 | 
        } 
 | 
    } 
 | 
} 
 |