Exemplo n.º 1
0
 public static int DeleteT_OE_USER_ROLE(int UserIDX, int RoleIDX)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             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.T_OE_USER_ROLES.Remove(row);
             ctx.SaveChanges();
             return(1);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 2
0
 public static int CreateT_OE_USER_ROLE(global::System.Int32 rOLE_IDX, global::System.Int32 uSER_IDX, int?cREATE_USER = 0)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         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_USERIDX = cREATE_USER;
             ctx.T_OE_USER_ROLES.Add(ur);
             ctx.SaveChanges();
             return(1);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }