Exemplo n.º 1
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void picOK_Click(object sender, EventArgs e)
 {
     if (CommHelper.Login(this.tbUserName.Text.Trim(), this.tbPwd.Text.Trim()))
     {
         string strIP = CommHelper.GetRealIP();
         var    temp  = EngineContext.Current.Resolve <IFN_LAYOUT_MAIN>();
         Parking.Core.Model.FN_LAYOUT_MAIN workModel = temp.GetLayOutByIP(strIP);
         if (null == workModel)
         {
             workModel = temp.GetLayOutByWORKSTATION(strIP);
         }
         if (null != workModel)
         {
             GlobalEnvironment.WorkStationInfo = workModel;
             GlobalEnvironment.LocalUserInfo.WORKSTATION_NO = GlobalEnvironment.WorkStationInfo.WORKSTATION_ID;
         }
         ICR_PARK_EXCHANGE bllRecord = EngineContext.Current.Resolve <ICR_PARK_EXCHANGE>();
         var model = bllRecord.GetModelByAccount(this.tbUserName.Text.Trim(), GlobalEnvironment.LocalUserInfo.WORKSTATION_NO);
         if (null == model)
         {
             bllRecord.Add(GlobalEnvironment.LocalUserInfo);
         }
         this.DialogResult = DialogResult.OK; //返回一个登录成功的对话框状态
         this.Close();                        //关闭登录窗口
     }
     else
     {
         new G5MessageBox("用户名或密码错误").ShowDialog();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 保存换班记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            string workUserName = GlobalEnvironment.LocalUserInfo.USER_ACCOUNT;
            string userName     = this.tbChangeRole.Text.Trim();
            //保存之前操作员信息
            ICR_PARK_EXCHANGE bllRecord = EngineContext.Current.Resolve <ICR_PARK_EXCHANGE>();
            var model = bllRecord.GetModelByAccount(workUserName, GlobalEnvironment.LocalUserInfo.WORKSTATION_NO);

            if (null != model)
            {
                model.WORK_STATUS = 1;
                model.DUE_MONEY   = GlobalEnvironment.LocalUserInfo.DUE_MONEY;
                model.PER_MONEY   = GlobalEnvironment.LocalUserInfo.PER_MONEY;
                model.EIXT_TIME   = DateTime.Now;
                bllRecord.Update(model);
            }
            if (userName != GlobalEnvironment.LocalUserInfo.USER_ACCOUNT)
            {
                //更新新的操作员对象信息
                string pwd = this.tbPwd.Text.Trim();
                if (CommHelper.Login(userName, pwd))
                {
                    GlobalEnvironment.LocalUserInfo.WORKSTATION_NO = GlobalEnvironment.WorkStationInfo.WORKSTATION_ID;
                    GlobalEnvironment.LocalUserInfo.DUE_MONEY      = 0;
                    GlobalEnvironment.LocalUserInfo.PER_MONEY      = 0;
                    var exchange = bllRecord.GetModelByAccount(userName, GlobalEnvironment.LocalUserInfo.WORKSTATION_NO);
                    if (null == exchange)
                    {
                        bllRecord.Add(GlobalEnvironment.LocalUserInfo);
                    }
                    this.DialogResult = DialogResult.OK;    //返回一个登录成功的对话框状态
                    ThreadMessageTransact.Instance.triggerEvent(new ProcessRecord()
                    {
                        OPERATER_TYPE = enumOperaterType.ChangeRole
                    }, false);
                    this.Close();   //关闭登录窗口
                }
                else
                {
                    new G5MessageBox("用户名或密码错误").ShowDialog();
                }
            }
        }
Exemplo n.º 3
0
        private void picOK_Click(object sender, EventArgs e)
        {
            string userName = this.tbUserName.Text.Trim();

            if (GlobalEnvironment.LocalUserInfo.USER_ACCOUNT.ToLower() == userName.ToLower())
            {
                if (CommHelper.Login(this.tbUserName.Text.Trim(), this.tbPwd.Text.Trim()))
                {
                    LockPanel.Close();
                    this.Close();    //关闭登录窗口
                }
                else
                {
                    new G5MessageBox("密码错误").ShowDialog();
                }
            }
            else
            {
                new G5MessageBox("用户名错误").ShowDialog();
            }
        }