public static Common.Models.Billing.Fee Edit(Common.Models.Billing.Fee model, Common.Models.Account.Users modifier) { model.ModifiedBy = modifier; model.Modified = DateTime.UtcNow; DBOs.Billing.Fee dbo = Mapper.Map <DBOs.Billing.Fee>(model); using (IDbConnection conn = Database.Instance.GetConnection()) { conn.Execute("UPDATE \"fee\" SET " + "\"incurred\"=@Incurred, \"amount\"=@Amount, \"details\"=@Details, " + "\"utc_modified\"=@UtcModified, \"modified_by_user_pid\"=@ModifiedByUserPId " + "WHERE \"id\"=@Id", dbo); } return(model); }
public static Common.Models.Billing.Fee Create(Common.Models.Billing.Fee model, Common.Models.Account.Users creator) { if (!model.Id.HasValue) { model.Id = Guid.NewGuid(); } model.CreatedBy = model.ModifiedBy = creator; model.Created = model.Modified = DateTime.UtcNow; DBOs.Billing.Fee dbo = Mapper.Map <DBOs.Billing.Fee>(model); using (IDbConnection conn = Database.Instance.GetConnection()) { conn.Execute("INSERT INTO \"fee\" (\"id\", \"incurred\", \"amount\", \"details\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " + "VALUES (@Id, @Incurred, @Amount, @Details, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)", dbo); } return(model); }
public static Common.Models.Billing.Fee Edit( Common.Models.Billing.Fee model, Common.Models.Account.Users modifier, IDbConnection conn = null, bool closeConnection = true) { model.ModifiedBy = modifier; model.Modified = DateTime.UtcNow; DBOs.Billing.Fee dbo = Mapper.Map <DBOs.Billing.Fee>(model); conn = DataHelper.OpenIfNeeded(conn); conn.Execute("UPDATE \"fee\" SET " + "\"incurred\"=@Incurred, \"amount\"=@Amount, \"details\"=@Details, " + "\"utc_modified\"=@UtcModified, \"modified_by_user_pid\"=@ModifiedByUserPId " + "WHERE \"id\"=@Id", dbo); DataHelper.Close(conn, closeConnection); return(model); }
public static Common.Models.Billing.Fee Create( Common.Models.Billing.Fee model, Common.Models.Account.Users creator, IDbConnection conn = null, bool closeConnection = true) { if (!model.Id.HasValue) { model.Id = Guid.NewGuid(); } model.CreatedBy = model.ModifiedBy = creator; model.Created = model.Modified = DateTime.UtcNow; DBOs.Billing.Fee dbo = Mapper.Map <DBOs.Billing.Fee>(model); conn = DataHelper.OpenIfNeeded(conn); conn.Execute("INSERT INTO \"fee\" (\"id\", \"incurred\", \"amount\", \"details\", \"utc_created\", \"utc_modified\", \"created_by_user_pid\", \"modified_by_user_pid\") " + "VALUES (@Id, @Incurred, @Amount, @Details, @UtcCreated, @UtcModified, @CreatedByUserPId, @ModifiedByUserPId)", dbo); DataHelper.Close(conn, closeConnection); return(model); }