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; }
public void Init() { RoleBll bll = new RoleBll(Ralid.Park.BusinessModel.Configuration.AppSettings.CurrentSetting.ParkConnect); this.DataSource = bll.GetAllRoles().QueryObjects; this.DisplayMember = "Name"; this.ValueMember = "RoleID"; this.DropDownStyle = ComboBoxStyle.DropDownList; }
protected override List<object> GetDataSource() { RoleBll roleBll = new RoleBll(AppSettings.CurrentSetting.ParkConnect); roles = roleBll.GetAllRoles().QueryObjects.ToList(); List<object> source = new List<object>(); foreach (object o in roles) { source.Add(o); } return source; }
private bool SyncRoles() { NotifyMsg(string.Format("{0}{1}......", Resources.Resource1.FrmSyncDataToStandby_Synchronizing, Resources.Resource1.FrmSyncDataToStandby_Role)); NotifyProgress(100, 0); bool success = true; CommandResult result = null; RoleBll masterbll = new RoleBll(AppSettings.CurrentSetting.CurrentMasterConnect); RoleBll standbybll = new RoleBll(AppSettings.CurrentSetting.CurrentStandbyConnect); QueryResultList <RoleInfo> infos = masterbll.GetAllRoles(); success = infos.Result == ResultCode.Successful; if (success) { success = standbybll.DeleteAllRoles().Result == ResultCode.Successful; if (success) { NotifyProgress(infos.QueryObjects.Count, 0); foreach (RoleInfo info in infos.QueryObjects) { result = standbybll.Insert(info); success = result.Result == ResultCode.Successful; NotifyProgress(null, null); if (!success) { break; } } } } if (!success) { NotifyMsg(string.Format("{0}{1}", Resources.Resource1.FrmSyncDataToStandby_Role, Resources.Resource1.Form_Fail), Color.Red); } else { NotifyMsg(string.Format("{0}{1}", Resources.Resource1.FrmSyncDataToStandby_Role, Resources.Resource1.Form_Success)); } return(success); }