public NvChuongTrinhKhuyenMai InsertPhieu(NvKhuyenMaiTichDiemVm.Dto instance) { var item = AutoMapper.Mapper.Map <NvKhuyenMaiTichDiemVm.Dto, NvChuongTrinhKhuyenMai>(instance); item.Id = Guid.NewGuid().ToString(); item.MaChuongTrinh = SaveCode(); var result = Insert(item); return(result); }
public NvChuongTrinhKhuyenMai UpdatePhieu(NvKhuyenMaiTichDiemVm.Dto instance) { var exsitItem = FindById(instance.Id); if (exsitItem.TrangThai == (int)ApprovalState.IsComplete) { return(null); } var masterData = Mapper.Map <NvKhuyenMaiTichDiemVm.Dto, NvChuongTrinhKhuyenMai>(instance); var result = Update(masterData); return(result); }