/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromGlacctauthcriteria(ref DataRow row, Glacctauthcriteria entity) { row.SetField("Option1Account", entity.option1Account); row.SetField("Option2Div", entity.option2Div); row.SetField("Option2Dept", entity.option2Dept); row.SetField("Option2Acct", entity.option2Acct); row.SetField("Option2Sub", entity.option2Sub); row.SetField("userfield", entity.userfield); }
public static Glacctauthcriteria BuildGlacctauthcriteriaFromRow(DataRow row) { Glacctauthcriteria entity = new Glacctauthcriteria(); entity.option1Account = row.IsNull("Option1Account") ? string.Empty : row.Field <string>("Option1Account"); entity.option2Div = row.IsNull("Option2Div") ? 0 : row.Field <int>("Option2Div"); entity.option2Dept = row.IsNull("Option2Dept") ? 0 : row.Field <int>("Option2Dept"); entity.option2Acct = row.IsNull("Option2Acct") ? 0 : row.Field <int>("Option2Acct"); entity.option2Sub = row.IsNull("Option2Sub") ? 0 : row.Field <int>("Option2Sub"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }