Exemplo n.º 1
0
        public void UpdateAccept(AcceptModel param)
        {
            // Get sysdate
            var currentDate = DateTime.Now;

            // Set item
            var entity = GetSingle<Accept>(param.AcceptSlipNo, false);
            entity.SlipStatus = param.SlipStatus;
            entity.UpdateUser = PageHelper.UserName;
            entity.UpdateDate = currentDate;
        }
Exemplo n.º 2
0
        public AcceptModel GetAccept(InitDataModel inputObject)
        {
            var result = from tbl in EntityManager.Accepts
                         where ((tbl.AcceptSlipNo == inputObject.AcceptSlipNo
                         && tbl.ClientCd == PageHelper.UserName)
                         || tbl.ViewId == inputObject.ViewId)
                         && tbl.DeleteFlag == false
                         select tbl;

            var acceptModel = new AcceptModel();

            DataHelper.CopyObject(result.SingleOrDefault(), acceptModel);
            acceptModel.TotalAmount = acceptModel.AcceptDetails.Where(o => o.DeleteFlag == false).Sum(o => o.DetailAmt);

            return acceptModel;
        }
Exemplo n.º 3
0
        public IList<AcceptModel> GetListAccepts(string userName)
        {
            var listAccept = from tbl in EntityManager.Accepts
                             where tbl.ClientCd == userName
                             && tbl.DeleteFlag == false
                             orderby tbl.UpdateDate ascending
                             select tbl;

            var listResult = new List<AcceptModel>();
            AcceptModel acceptModel = null;

            foreach (var obj in listAccept.ToList())
            {
                acceptModel = new AcceptModel();
                DataHelper.CopyObject(obj, acceptModel);
                acceptModel.TotalAmount = acceptModel.AcceptDetails.Where(o => o.DeleteFlag == false).Sum(o => o.DetailAmt);
                listResult.Add(acceptModel);
            }

            return listResult;
        }