internal bool UpgradeArchitectureToRemote(out Exception ex) { ex = null; int errCount = 0; try { Architecture a = this.CurrentArchitecture; List <KellRole.Action> atcs = a.Acts; List <Department> deps = a.Deps; List <Module> mods = a.Mods; List <Permission> perms = a.Pers; List <Role> roles = a.Roles; List <UserGroup> ugrps = a.Ugroups; List <User> users = a.Users; ActionLogic.GetInstance().UpgradeList(atcs); DepartmentLogic.GetInstance().UpgradeList(deps); ModuleLogic.GetInstance().UpgradeList(mods); PermissionLogic.GetInstance().UpgradeList(perms); RoleLogic.GetInstance().UpgradeList(roles); UserGroupLogic.GetInstance().UpgradeList(ugrps); UserLogic.GetInstance().UpgradeList(users); } catch (Exception e) { errCount++; ex = e; } return(errCount == 0); }
private static Architecture GetRemoteArchitecture() { Architecture a = Architecture.Empty; a.Deps = DepartmentLogic.GetInstance().GetAllDepartments(); a.Ugroups = UserGroupLogic.GetInstance().GetAllUserGroups(); a.Users = UserLogic.GetInstance().GetAllUsers(); a.Mods = ModuleLogic.GetInstance().GetAllModules(); a.Acts = ActionLogic.GetInstance().GetAllActions(); a.Pers = PermissionLogic.GetInstance().GetAllPermissions(); a.Roles = RoleLogic.GetInstance().GetAllRoles(); return(a); }
private void btn_Actn_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { KellRole.Action action = new KellRole.Action(); action.ID = data[comboBox1.SelectedIndex].ID; action.Name = textBox1.Text.Trim(); action.FormName = textBox3.Text.Trim(); action.ControlName = textBox4.Text.Trim(); action.Remark = textBox2.Text; ActionLogic al = ActionLogic.GetInstance(); if (al.ExistsNameOther(action.Name, action.ID)) { if (MessageBox.Show("系统中已经存在该名称,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { if (al.UpdateAction(action)) { data[comboBox1.SelectedIndex].Name = action.Name; data[comboBox1.SelectedIndex].FormName = action.FormName; data[comboBox1.SelectedIndex].ControlName = action.ControlName; data[comboBox1.SelectedIndex].Remark = action.Remark; RefreshInfo(); MessageBox.Show("修改成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { if (al.UpdateAction(action)) { data[comboBox1.SelectedIndex].Name = action.Name; data[comboBox1.SelectedIndex].FormName = action.FormName; data[comboBox1.SelectedIndex].ControlName = action.ControlName; data[comboBox1.SelectedIndex].Remark = action.Remark; RefreshInfo(); MessageBox.Show("修改成功!"); } } } else { MessageBox.Show("先选定要修改的项目!"); } }
private void button1_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { if (MessageBox.Show("确定要删除该项目?", "删除提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { KellRole.Action action = data[comboBox1.SelectedIndex]; if (ActionLogic.GetInstance().DeleteAction(action)) { data.RemoveAt(comboBox1.SelectedIndex); RefreshInfo(); } } } else { MessageBox.Show("先选定要删除的项目!"); } }
private void button19_Click(object sender, EventArgs e) { KellRole.Action action = new KellRole.Action(); action.Name = textBox1.Text.Trim(); action.FormName = textBox3.Text.Trim(); action.ControlName = textBox4.Text.Trim(); action.Remark = textBox2.Text; ActionLogic al = ActionLogic.GetInstance(); if (al.ExistsName(action.Name)) { if (MessageBox.Show("系统中已经存在该名称,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { int id = al.AddAction(action); if (id > 0) { action.ID = id; data.Add(action); RefreshInfo(); MessageBox.Show("添加成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { int id = al.AddAction(action); if (id > 0) { action.ID = id; data.Add(action); RefreshInfo(); MessageBox.Show("添加成功!"); } } }