public ChangeWorkerLogin()
 {
     InitializeComponent();
     pmc = new ParkManagerControl();
     pc  = new ParkControl();
     cbxsource();
 }
        public LoginPark()
        {
            InitializeComponent();
            pmc = new ParkManagerControl();
            pc  = new ParkControl();
            cbxsource();
            SystemControl sc  = new SystemControl();
            bool          res = sc.CheckDatabaseOrCreate();

            if (res == false)
            {
                MessageBox.Show("创建数据库失败!请检查数据库用户名密码是否正确");
                this.Close();
            }
        }
Exemple #3
0
        public void GetMangerInfo() //获得管理员信息
        {
            ParkManagerControl pmc = new ParkManagerControl();

            if (Model.DicValue.IsManOrDoor == "管理员")
            {
                ParkManagerEntity GetParkManagerInfo = pmc.GetParkManager(Model.DicValue.MangerID);
                if (GetParkManagerInfo != null)
                {
                    if (GetParkManagerInfo.Nickname != null)
                    {
                        this.WorkerName.Content     = GetParkManagerInfo.Nickname;
                        Model.DicValue.MangerParkID = GetParkManagerInfo.ParkId;
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("获取管理员昵称失败!");
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show("获取管理员信息失败!");
                }
            }
            if (Model.DicValue.IsManOrDoor == "门卫")
            {
                ParkManagerEntity GetParkDoorInfo = pmc.GetParkDoorman(Model.DicValue.MangerID);
                if (GetParkDoorInfo != null)
                {
                    if (GetParkDoorInfo.Nickname != null)
                    {
                        this.WorkerName.Content     = GetParkDoorInfo.Nickname;
                        Model.DicValue.MangerParkID = GetParkDoorInfo.ParkId;
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("获取门卫昵称失败!");
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show("获取门卫信息失败!");
                }
            }
        }
Exemple #4
0
        private void LayoutWorker_Click(object sender, RoutedEventArgs e)//注销
        {
            ParkManagerControl pmc = new ParkManagerControl();

            if (Model.DicValue.IsManOrDoor == "管理员")
            {
                if (Model.DicValue.MangerParkID != -1)
                {
                    int res = pmc.ParkManagerLogout(Model.DicValue.MangerParkID);
                    if (res > 0)
                    {
                        WorkerName.Content = null;
                        System.Windows.MessageBox.Show("您已下线,你的下线时间为:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("下线失败!");
                    }
                }
            }
            if (Model.DicValue.IsManOrDoor == "门卫")
            {
                if (Model.DicValue.MangerParkID != -1)
                {
                    int res = pmc.DoormanLogout(Model.DicValue.MangerParkID);
                    if (res > 0)
                    {
                        WorkerName.Content = null;
                        System.Windows.MessageBox.Show("您已下线,你的下线时间为:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("下线失败!");
                    }
                }
            }
        }
 public RegisterPark()
 {
     InitializeComponent();
     pc  = new ParkControl();
     pmc = new ParkManagerControl();
 }