Exemplo n.º 1
0
        private List <StockChangeDetail> GetChildOnCreate(StockChange master, StockChangeComplex source)
        {
            List <StockChangeDetail> infos = new List <StockChangeDetail>();
            var wanted = source.ChildList.Where(x => x.IsDirty == true);

            foreach (var item in wanted)
            {
                StockChangeDetail temp = Mapper.Map <StockChangeDetail>(item);
                temp.StockChangeID = master.StockChangeID;
                temp.LastPerson    = IdentityService.GetUserData().UserID;
                temp.LastUpdate    = DateTime.Now;
                infos.Add(temp);
            }
            return(infos);
        }
Exemplo n.º 2
0
        public void RemoveChild(long id)
        {
            #region 取資料
            StockChangeDetail query = this._DetailRepository.Get(x => x.SeqNo == id);
            #endregion

            #region 邏輯驗證
            if (query == null)//沒有資料
            {
                throw new Exception("MessageNoData".ToLocalized());
            }

            #endregion

            #region 變為Models需要之型別及邏輯資料

            #endregion

            #region Models資料庫
            this._DetailRepository.Delete(query);
            this._UnitOfWork.SaveChange();
            #endregion
        }