public static DTO_CUS_SYS_PermissionList post_CUS_SYS_PermissionList(AppEntities db, int PartnerID, DTO_CUS_SYS_PermissionList item, string Username) { tbl_CUS_SYS_PermissionList dbitem = new tbl_CUS_SYS_PermissionList(); if (item != null) { dbitem.IDRole = item.IDRole; dbitem.IDForm = item.IDForm; dbitem.Value = item.Value; dbitem.Visible = item.Visible; dbitem.IDPartner = PartnerID; try { db.tbl_CUS_SYS_PermissionList.Add(dbitem); db.SaveChanges(); BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_SYS_PermissionList", DateTime.Now, Username); item.ID = dbitem.ID; item.IDPartner = dbitem.IDPartner; } catch (DbEntityValidationException e) { errorLog.logMessage("post_CUS_SYS_PermissionList", e); item = null; } } return(item); }
public static DTO_CUS_SYS_PermissionList toDTO(tbl_CUS_SYS_PermissionList dbResult) { if (dbResult != null) { return(new DTO_CUS_SYS_PermissionList() { IDPartner = dbResult.IDPartner, IDRole = dbResult.IDRole, IDForm = dbResult.IDForm, ID = dbResult.ID, Value = dbResult.Value, Visible = dbResult.Visible, }); } else { return(null); } }