コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }