public int Create(AssetManager.Models.BlockRequest failure) { failure.RequestedBy = this.Context.User.Id; failure.RquestedOn = DateTime.UtcNow; Data.Model.BlockRquest prdct = failure.MapTo <Data.Model.BlockRquest>(); prdct.SetAuditFieldsOnCreate <Data.Model.BlockRquest>(this.Context); failure.Id = Convert.ToInt32(this.DB.Insert(prdct)); return(failure.Id); }
public bool Update(AssetManager.Models.BlockRequest failure) { var exisitingProduct = this.DB.SingleOrDefault <Data.Model.BlockRquest>("Where id =@0", failure.Id); Data.Model.BlockRquest prdct = failure.MapTo <Data.Model.BlockRquest>(); prdct.SetAuditFieldsOnUpdate <Data.Model.BlockRquest>(this.Context); this.DB.Update(prdct, new List <string> { "DepartmentId", "SectionId", "BoardId", "BlockSectionName", "Direction", "Description", "RequestDuration", "AllowedDuration", "NumberOfBlocks", "AllowedDate", "RequestDate", "ModifiedBy", "DateModified" }); return(true); }