示例#1
0
        /// <summary>
        /// 是否缴纳物业费
        /// </summary>
        /// <returns></returns>
        public static PropertyExpend GetPropertyExpend(string vehicleNo)
        {
            PropertyExpend propertyExpend = null;

            try
            {
                CalendarInfo calendarInfo = new CalendarInfo();
                //获取当前工作站
                string url      = ConfigurationManager.AppSettings["serverUrl"].ToString();
                string authCode = CommHelper.Str(6);
                string token    = CommHelper.Md5(CommHelper.StringToHexString(authCode)).ToUpper();
                string data     = "authCode=" + authCode + "&token=" + token + "&vehicleNo=" + vehicleNo;
                string result   = CommHelper.Post(url + "/propertyExpendQuery.eif?", data);
                propertyExpend = CommHelper.FromJsonTo <PropertyExpend>(result);
            }
            catch { return(null); }
            return(propertyExpend);
        }
示例#2
0
        /// <summary>
        /// 获取节假日信息
        /// </summary>
        /// <returns></returns>
        public static CalendarInfo GetWorkingDays(string dateTime)
        {
            CalendarInfo calendarInfo = null;
            //获取当前工作站
            string      url      = ConfigurationManager.AppSettings["serverUrl"].ToString();
            string      authCode = CommHelper.Str(6);
            string      token    = CommHelper.Md5(CommHelper.StringToHexString(authCode)).ToUpper();
            string      data     = "authCode=" + authCode + "&token=" + token + "&dateTime=" + dateTime;
            string      result   = CommHelper.Post(url + "/workingDaysVal.eif?", data);
            WorkingDays workDay  = CommHelper.FromJsonTo <WorkingDays>(result);

            if (workDay != null)
            {
                if (workDay.resStatus == 1)
                {
                    calendarInfo = workDay.calendarInfo;
                }
                else
                {
                    LogHelper.Log.Error(workDay.resRemark);
                }
            }
            return(calendarInfo);
        }
示例#3
0
        /// <summary>
        /// 登入
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public static bool Login(string userName, string pwd)
        {
            bool isLogin = false;

            try
            {
                if (!ConfigHelper.LoginFromLocal)
                {
                    string         url      = ConfigurationManager.AppSettings["serverUrl"].ToString();
                    string         authCode = CommHelper.Str(6);
                    string         token    = CommHelper.Md5(CommHelper.StringToHexString(authCode)).ToUpper();
                    string         data     = "authCode=" + authCode + "&token=" + token + "&userAccount=" + userName + "&userPwd=" + pwd;
                    string         result   = CommHelper.Post(url + "/loginAuth.eif?", data);
                    returnUserInfo userInfo = CommHelper.FromJsonTo <returnUserInfo>(result);
                    if (userInfo.resStatus == 1)
                    {
                        if (null != userInfo.userInfo)
                        {
                            GlobalEnvironment.LocalUserInfo              = new CR_PARK_EXCHANGE();
                            GlobalEnvironment.LocalUserInfo.ID           = Guid.NewGuid().ToString("N");
                            GlobalEnvironment.LocalUserInfo.USER_ID      = userInfo.userInfo.id;
                            GlobalEnvironment.LocalUserInfo.USER_ACCOUNT = userInfo.userInfo.userAccount;
                            GlobalEnvironment.LocalUserInfo.USER_NAME    = userInfo.userInfo.userName;
                            GlobalEnvironment.LocalUserInfo.LOGIN_TIME   = DateTime.Now;
                            GlobalEnvironment.LocalUserInfo.EIXT_TIME    = DateTime.Now;
                            GlobalEnvironment.LocalUserInfo.EIXT_NUM     = 0;
                            GlobalEnvironment.LocalUserInfo.ENTER_NUM    = 0;
                            GlobalEnvironment.LocalUserInfo.DUE_MONEY    = 0;
                            GlobalEnvironment.LocalUserInfo.PER_MONEY    = 0;
                            GlobalEnvironment.LocalUserInfo.WORK_STATUS  = 0;
                            isLogin = true;
                        }
                    }
                }
                else
                {
                    //var temp = EngineContext.Current.Resolve<IBAS_SYSTEM_USER>();
                    //var model = temp.Login(userName, pwd);
                    //if (null != model)
                    //{
                    //    GlobalEnvironment.LocalUserInfo = new CR_PARK_EXCHANGE();
                    //    GlobalEnvironment.LocalUserInfo.ID = model.ID;
                    //    GlobalEnvironment.LocalUserInfo.USER_ACCOUNT = userName;
                    //    GlobalEnvironment.LocalUserInfo.USER_NAME = model.USER_NAME;
                    //    GlobalEnvironment.LocalUserInfo.LOGIN_TIME = DateTime.Now;
                    //    GlobalEnvironment.LocalUserInfo.EIXT_NUM = 0;
                    //    GlobalEnvironment.LocalUserInfo.ENTER_NUM = 0;
                    //    isLogin = true;
                    //}

                    GlobalEnvironment.LocalUserInfo              = new CR_PARK_EXCHANGE();
                    GlobalEnvironment.LocalUserInfo.ID           = "afdfad";
                    GlobalEnvironment.LocalUserInfo.USER_ACCOUNT = "Admin";
                    GlobalEnvironment.LocalUserInfo.USER_NAME    = "Admin";
                    GlobalEnvironment.LocalUserInfo.LOGIN_TIME   = DateTime.Now;
                    GlobalEnvironment.LocalUserInfo.EIXT_NUM     = 0;
                    GlobalEnvironment.LocalUserInfo.ENTER_NUM    = 0;
                    isLogin = true;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Log.Error(ex.Message);
            }
            return(isLogin);
        }