Exemple #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();
                }
            }
        }
Exemple #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;
        }
Exemple #3
0
 public static bool Update(UserGroup data)
 {
     return UserGroupDao.Update(data);
 }
Exemple #4
0
 public static bool Insert(UserGroup data)
 {
     return UserGroupDao.Insert(data);
 }
Exemple #5
0
 public static bool Delete(UserGroup data)
 {
     return UserGroupDao.Delete(data);
 }
Exemple #6
0
        public static bool Update(UserGroup data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.SubmitChanges();
                    return true;
                }

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

                return true;
            }
            catch
            {
                return false;
            }
        }
 partial void DeleteUserGroup(UserGroup instance);
 partial void UpdateUserGroup(UserGroup instance);
Exemple #10
0
 partial void InsertUserGroup(UserGroup instance);