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();
     }
 }
        private void Initialize()
        {
            this.lbCarNo.Text = recordInfo.INOUT_RECODE.VEHICLE_NO;
            var temp = GlobalEnvironment.ListOragnization.Where(x => x.IP == CommHelper.GetRealIP() && x.channelType == enumChannelType.wsn).FirstOrDefault();

            this.lbChannelName.Text = recordInfo.CHN_NAME;
        }
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HandReleaseForm_Load(object sender, EventArgs e)
        {
            tbCarNo.Text = dataUploadRecord.plateNum;
            if (null == dataUploadRecord.REPORTIMG_TIME)
            {
                lbInOutTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                lbInOutTime.Text = dataUploadRecord.REPORTIMG_TIME.ToString("yyyy-MM-dd HH:mm:ss");
            }
            lbInOut.Text = dataUploadRecord.CHANNEL_TYPE == enumChannelType.chn_in ? "入场时间 :" : "出场时间 :";

            List <Equipment> orgBase = new List <Equipment>();
            string           Ip      = CommHelper.GetRealIP();

            GlobalEnvironment.ListOragnization.Where(x => x.channelType == enumChannelType.wsn).ToList().ForEach(delegate(Equipment o)
            {
                if (o.Attributes.ContainsKey("IP"))
                {
                    if (Ip == o.Attributes["IP"])
                    {
                        GetChannel(ref orgBase, o.ORGANIZATION_CODE);
                    }
                }
            });
            this.cbChannelCode.DataSource    = orgBase.Where(X => X.channelType == dataUploadRecord.CHANNEL_TYPE).ToList();
            this.cbChannelCode.DisplayMember = "ORGANIZATION_NAME";
            this.cbChannelCode.ValueMember   = "ORGANIZATION_CODE";
            List <Parking.Core.Model.BAS_SYSTEM_DATA_DICT> dataList = bllDataDict.GetListByParentModelKey("VEHICLE_TYPE");

            this.cmbCarType.DataSource    = dataList;
            this.cmbCarType.DisplayMember = "MODEL_NAME";
            this.cmbCarType.ValueMember   = "MODEL_VALUE";
        }
        private void UnlicensedCarsEnter_Load(object sender, EventArgs e)
        {
            if (null == dataUploadRecord.REPORTIMG_TIME)
            {
                lbInOutTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                lbInOutTime.Text = dataUploadRecord.REPORTIMG_TIME.ToString("yyyy-MM-dd HH:mm:ss");
            }
            lbInOut.Text = dataUploadRecord.CHANNEL_TYPE == enumChannelType.chn_in ? "入场时间 :" : "出场时间 :";

            List <OragnizationBase> orgBase = new List <OragnizationBase>();
            string Ip = CommHelper.GetRealIP();

            GlobalEnvironment.ListOragnization.Where(x => x.channelType == enumChannelType.wsn).ToList().ForEach(delegate(Equipment o)
            {
                if (o.Attributes.ContainsKey("IP"))
                {
                    if (Ip == o.Attributes["IP"])
                    {
                        GetChannel(ref orgBase, o.ORGANIZATION_CODE);
                    }
                }
            });
            this.cbChannelCode.DataSource    = orgBase.Where(X => X.channelType == dataUploadRecord.CHANNEL_TYPE).ToList();
            this.cbChannelCode.DisplayMember = "ORGANIZATION_NAME";
            this.cbChannelCode.ValueMember   = "ORGANIZATION_CODE";
        }