public static int DeleteT_VCCB_USER_ROLE(int UserIDX, int RoleIDX) { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { try { T_OE_USER_ROLES row = new T_OE_USER_ROLES(); row = (from c in ctx.T_OE_USER_ROLES where c.ROLE_IDX == RoleIDX && c.USER_IDX == UserIDX select c).FirstOrDefault(); ctx.DeleteObject(row); ctx.SaveChanges(); return(1); } catch (Exception ex) { return(0); } } }
public static int CreateT_VCCB_USER_ROLE(global::System.Int32 rOLE_IDX, global::System.Int32 uSER_IDX, global::System.String cREATE_USER = "******") { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { try { T_OE_USER_ROLES ur = new T_OE_USER_ROLES(); ur.ROLE_IDX = rOLE_IDX; ur.USER_IDX = uSER_IDX; ur.CREATE_DT = System.DateTime.Now; ur.CREATE_USERID = cREATE_USER; ctx.AddToT_OE_USER_ROLES(ur); ctx.SaveChanges(); return(1); } catch (Exception ex) { return(0); } } }