示例#1
0
        private Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet createObj()
        {
            var obj = new Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet();

            obj.CtrVersion            = CtrVersion;
            obj.PhieuCongTacChiTietId = PhieuCongTacChiTietId;

            obj.NoiDung = NoiDung;
            obj.Ngay    = Ngay;
            obj.SoLuong = SoLuong;
            obj.DonGia  = DonGia;
            obj.GhiChu  = GhiChu;

            return(obj);
        }
示例#2
0
        private Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet createObj()
        {
            var obj = new Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet();

            obj.CtrVersion     = 1;
            obj.PhieuCongTacId = PhieuCongTacId;
            obj.MaTrangThai    = "PCTCT_DD";
            obj.XoaYN          = "N";
            obj.NgayTao        = DateTime.Now;

            obj.NoiDung = NoiDung;
            obj.Ngay    = Ngay;
            obj.SoLuong = SoLuong;
            obj.DonGia  = DonGia;
            obj.GhiChu  = GhiChu;

            return(obj);
        }
示例#3
0
        public async Task <dynamic> Execute(ContextDto context)
        {
            try
            {
                init();
                validate();

                if (_list != null && _list.Count > 0)
                {
                    var repo = new PhieuCongTacChiTietRepository(context);

                    foreach (var model in _list)
                    {
                        if (model.PhieuCongTacChiTietId > 0)
                        {
                            var entity = new Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet();
                            entity.PhieuCongTacChiTietId = model.PhieuCongTacChiTietId;
                            entity.CtrVersion            = model.CtrVersion;

                            entity.XoaYN = "Y";

                            entity = await repo.UpdatePartial(entity,
                                                              nameof(Entity.MSSQL_QLDN_QLNS.Entity.PhieuCongTacChiTiet.XoaYN)
                                                              );

                            model.XoaYN = entity.XoaYN;
                        }
                    }
                }

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, _list, null));
            }
            catch (FormatException ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.BadRequest, ex.Message));
            }
            catch (Exception ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.InternalServerError, ex.Message));
            }
        }