예제 #1
0
        public static int UpdateT_VCCB_ROLE(int idx, string newROLE_NAME, string newROLE_DESC, string newMODIFY_USR)
        {
            try
            {
                TOeRoles row = new TOeRoles();
                row = (from c in _db.TOeRoles where c.RoleIdx == idx select c).First();

                if (newROLE_NAME != null)
                {
                    row.RoleName = newROLE_NAME;
                }

                if (newROLE_DESC != null)
                {
                    row.RoleDesc = newROLE_DESC;
                }

                if (newMODIFY_USR != null)
                {
                    row.ModifyUserid = newMODIFY_USR;
                }

                row.ModifyDt = System.DateTime.Now;
                _db.TOeRoles.Update(row);
                _db.SaveChanges();
                return(1);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
예제 #2
0
 public static int DeleteT_VCCB_ROLE(int idx)
 {
     try
     {
         TOeRoles row = new TOeRoles();
         row = (from c in _db.TOeRoles where c.RoleIdx == idx select c).First();
         _db.TOeRoles.Remove(row);
         _db.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
예제 #3
0
        //*****************ROLES **********************************
        public static int CreateT_OE_ROLES(global::System.String rOLE_NAME, global::System.String rOLE_DESC, global::System.String cREATE_USER = "******")
        {
            try
            {
                TOeRoles r = new TOeRoles();
                r.RoleName     = rOLE_NAME;
                r.RoleDesc     = rOLE_DESC;
                r.CreateDt     = System.DateTime.Now;
                r.CreateUserid = cREATE_USER;

                _db.TOeRoles.Add(r);
                _db.SaveChanges();
                return(1);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }