public static int Insert(MProfile ent, List <MProfileOptions> entOpcs, ref int ProfileId) { int result = DAProfile.Insert(ent, ref ProfileId); if (result.Equals(0)) { foreach (MProfileOptions opc in entOpcs) { opc.ProfileId = ProfileId; result = DAProfile.InsertOptions(opc); } } return(result); }
public static int Update(MProfile ent, List <MProfileOptions> entOpcs) { int result = DAProfile.Update(ent); if (result.Equals(0)) { result = DAProfile.DeleteOptions(ent); if (result.Equals(0)) { foreach (MProfileOptions opc in entOpcs) { opc.ProfileId = ent.ProfileId; result = DAProfile.InsertOptions(opc); } } } return(result); }