public void Init() { RoleBll bll = new RoleBll(LJH.Attendance.Model.AppSettings.CurrentSetting.ConnectUri); this.DataSource = bll.GetAllRoles().QueryObjects; this.DisplayMember = "Name"; this.ValueMember = "ID"; this.DropDownStyle = ComboBoxStyle.DropDownList; }
protected override List<object> GetDataSource() { RoleBll roleBll = new RoleBll(AppSettings.CurrentSetting.ConnectUri); roles = roleBll.GetAllRoles().QueryObjects.ToList(); List<object> source = new List<object>(); foreach (object o in roles) { source.Add(o); } return source; }
protected override bool DeletingItem(object item) { RoleBll bll = new RoleBll(AppSettings.CurrentSetting.ConnectUri); Role info = (Role)item; CommandResult result = bll.Delete(info); if (result.Result != ResultCode.Successful) { MessageBox.Show(result.Message,LJH.Attendance.UI.Properties.Resources.Form_Alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); } return result.Result == ResultCode.Successful; }