示例#1
0
        private void CheckAndCreateDefaultUserGroup()
        {
            if (UserGroupBus.GetCount(Constant.DEFAULT_USER_GROUP_ADMIN_NAME) < 1)
            {
                DTO.UserGroup data = new DTO.UserGroup();

                data.Ten = Constant.DEFAULT_USER_GROUP_ADMIN_NAME;

                if (!UserGroupBus.Insert(data))
                {
                    MessageBox.Show(Constant.MESSAGE_ERROR, Constant.CAPTION_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
            }
        }
示例#2
0
        public static bool Delete(UserGroup data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.UserGroups.DeleteOnSubmit(data);
                    dbContext.SubmitChanges();

                    return true;
                }

                return false;
            }
            catch
            {
                //return false;
            }

            CreateSQlConnection();

            return false;
        }
示例#3
0
 public static bool Update(UserGroup data)
 {
     return UserGroupDao.Update(data);
 }
示例#4
0
 public static bool Insert(UserGroup data)
 {
     return UserGroupDao.Insert(data);
 }
示例#5
0
 public static bool Delete(UserGroup data)
 {
     return UserGroupDao.Delete(data);
 }
示例#6
0
        public static bool Update(UserGroup data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.SubmitChanges();
                    return true;
                }

                return false;
            }
            catch
            {
                return false;
            }
        }
示例#7
0
        public static bool Insert(UserGroup data)
        {
            try
            {
                dbContext.UserGroups.InsertOnSubmit(data);
                dbContext.SubmitChanges();

                return true;
            }
            catch
            {
                return false;
            }
        }
示例#8
0
 partial void DeleteUserGroup(UserGroup instance);
示例#9
0
 partial void UpdateUserGroup(UserGroup instance);
示例#10
0
 partial void InsertUserGroup(UserGroup instance);