Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
        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);
        }