예제 #1
0
 public bool UpdateRoleType(role_type oRoleType)
 {
     try
     {
         role_type ro = _entities.role_type.Find(oRoleType.role_type_id);
         ro.role_type_name = oRoleType.role_type_name;
         ro.description    = oRoleType.description;
         _entities.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
예제 #2
0
        public bool DeleteRoleType(long role_Type_id)
        {
            try
            {
                role_type oRoleType = _entities.role_type.FirstOrDefault(r => r.role_type_id == role_Type_id);
                _entities.role_type.Attach(oRoleType);
                _entities.role_type.Remove(oRoleType);

                _entities.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
예제 #3
0
        public bool InsertRoleType(role_type oRoleType)
        {
            try
            {
                role_type insert_roleType = new role_type
                {
                    role_type_name = oRoleType.role_type_name,
                    description    = oRoleType.description
                };
                _entities.role_type.Add(insert_roleType);
                _entities.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }