public bool InsertUpdateDelete(DataSet ds)
{
Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
DbCommand commandInsert = db.GetStoredProcCommand("usp_GuaranteeInsert");
db.AddInParameter(commandInsert, "@CompanyId", DbType.Int32, "CompanyId", DataRowVersion.Current);
db.AddInParameter(commandInsert, "@GuaranteeName", DbType.String, "GuaranteeName", DataRowVersion.Current);
db.AddInParameter(commandInsert, "@GuaranteeDescription", DbType.String, "GuaranteeDescription", DataRowVersion.Current);
db.AddInParameter(commandInsert, "@CreatedUser", DbType.Int32, "CreatedUser", DataRowVersion.Current);
db.AddInParameter(commandInsert, "@StatusId", DbType.Int32, "StatusId", DataRowVersion.Current);
DbCommand commandUpdate = db.GetStoredProcCommand("usp_GuaranteeUpdate");
db.AddInParameter(commandUpdate, "@GuaranteeId", DbType.Int32, "GuaranteeId", DataRowVersion.Current);
db.AddInParameter(commandUpdate, "@GuaranteeName", DbType.String, "GuaranteeName", DataRowVersion.Current);
db.AddInParameter(commandUpdate, "@GuaranteeDescription", DbType.String, "GuaranteeDescription", DataRowVersion.Current);
db.AddInParameter(commandUpdate, "@UpdatedUser", DbType.Int32, "UpdatedUser", DataRowVersion.Current);
db.AddInParameter(commandUpdate, "@StatusId", DbType.Int32, "StatusId", DataRowVersion.Current);
DbCommand commandDelete = db.GetStoredProcCommand("usp_GuaranteeDelete");
db.AddInParameter(commandDelete, "@GuaranteeId", DbType.Int32, "GuaranteeId", DataRowVersion.Current);
db.UpdateDataSet(ds, ds.Tables[0].TableName, commandInsert, commandUpdate, commandDelete, UpdateBehavior.Transactional);
return true;
}