/// <summary>
 /// 计算餐厅是否可以送餐
 /// </summary>
 /// <param name="status">餐厅营业状态</param>
 /// <param name="deliverTime">餐厅可以送餐时间</param>
 /// <returns>true表示可以送餐,false不可以送餐</returns>
 public Boolean GetDeliveryStatus(BusinessStatus status, DeliveryTime[] deliverTime)
 {
     if (status == BusinessStatus.Close)
     {
         return false;
     }
     var now = DateTime.Now;
     return deliverTime.Count(d => now > d.Start.GetDateTime() && now <= d.End.GetDateTime()) > 0;
 }
示例#2
0
        /// <summary>
        /// 计算餐厅是否可以送餐
        /// </summary>
        /// <param name="status">餐厅营业状态</param>
        /// <param name="deliverTime">餐厅可以送餐时间</param>
        /// <returns>true表示可以送餐,false不可以送餐</returns>
        public Boolean GetDeliveryStatus(BusinessStatus status, DeliveryTime[] deliverTime)
        {
            if (status == BusinessStatus.Close)
            {
                return(false);
            }
            var now = DateTime.Now;

            return(deliverTime.Count(d => now > d.Start.GetDateTime() && now <= d.End.GetDateTime()) > 0);
        }
示例#3
0
        /// <summary>
        /// Add/Update business status
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> AddBusinessStatus(int id)
        {
            var businessStatus = await _masterService.GetBusinessStatusById(id);

            if (businessStatus == null)
            {
                businessStatus = new BusinessStatus();
            }

            return(PartialView("_BusinessStatusWizard", businessStatus));
        }
示例#4
0
        public static Result GetResult(BusinessStatus status, int msgCode, IMessage message, string data)
        {
            Result result = new Result();

            result.Status     = status;
            result.StatusCode = msgCode;
            result.Data       = data;
            result.Message    = Result.GetMessage(msgCode, message);

            return(result);
        }
 public BusinessStatus GetStatus(BusinessStatus status, BusinessTime time)
 {
     if (status == BusinessStatus.Close)
     {
         return BusinessStatus.Close;
     }
     var now = DateTime.Now;
     if (now >= time.Start.GetDateTime() && now < time.End.GetDateTime())
     {
         return BusinessStatus.Open;
     }
     return BusinessStatus.Close;
 }
示例#6
0
        /// <summary>
        /// Populate dropdown for add and edit model
        /// </summary>
        /// <param name="status"></param>
        private void PopulateDropdown(BusinessStatus status = 0)
        {
            ViewBag.StatusList = Enum.GetNames(typeof(BusinessStatus)).Select(name => new CheckBoxModel
            {
                //get enum from string using
                IsChecked = status.Equals(EnumHelper.ParseEnum <BusinessStatus>(name)),
                Text      = name,
                Value     = name
            });

            var markupPlans = _context.MarkupPlan.ToList();

            ViewBag.MarkupPlans = markupPlans.Select(m => new SelectListItem(m.Name, m.Id.ToString()));
        }
示例#7
0
        public BusinessStatus GetStatus(BusinessStatus status, BusinessTime time)
        {
            if (status == BusinessStatus.Close)
            {
                return(BusinessStatus.Close);
            }
            var now = DateTime.Now;

            if (now >= time.Start.GetDateTime() && now < time.End.GetDateTime())
            {
                return(BusinessStatus.Open);
            }
            return(BusinessStatus.Close);
        }
 public BusinessCreateViewModel()
 {
     CountryList = Country.GetDropDownList();
     StateList   = new List <SelectListItem>()
     {
         new SelectListItem()
         {
             Text  = "Select State",
             Value = ""
         }
     };
     BusinessTypeList = DataAccess.BusinessType.GetDropDownList();
     CategoryList     = Category.GetDropDownList();
     StatusList       = BusinessStatus.GetDropDownList();
 }
示例#9
0
        public List <AgentBusinessData> GetWithStatus(BusinessStatus s, IPrincipal user)
        {
            var businessItems = new List <BusinessItem>();

            foreach (var b in IndexHelper.GetAllBusinesses(user, _context))
            {
                var status = 0;
                if (b.Data == null)
                {
                    continue;
                }
                var name           = b.Data.RecipientName;
                var visits         = _context.Visits.Where(v => v.BusinessId == b.Business.Id);
                var lastAddedVisit = visits.FirstOrDefault(v => v.VisitDate == visits.Max(a => a.VisitDate));
                if (lastAddedVisit != null)
                {
                    var step8 = _context.ClientSteps8.FirstOrDefault(c => c.VisitId == lastAddedVisit.Id);
                    if (step8 != null)
                    {
                        status = step8.Status;
                    }
                }

                if ((BusinessStatus)status != s)
                {
                    continue;
                }

                businessItems.Add(new BusinessItem
                {
                    Status = (BusinessStatus)status,
                    Name   = name,
                    Id     = b.Business.Id
                });
            }

            var datas = new List <AgentBusinessData>();
            var agent = _context.Users.Single(u => u.Id == ((CustomPrincipal)user).CustomIdentity.UserId);

            datas.Add(new AgentBusinessData
            {
                AgentFullName = agent.FirstName + " " + agent.LastName,
                Businesses    = businessItems
            });
            return(datas);
        }
示例#10
0
        /// <summary>
        /// Add update business status
        /// </summary>
        /// <param name="documentType"></param>
        /// <returns></returns>
        public async Task AddUpdateBusinessStatus(BusinessStatus businessStatus)
        {
            if (businessStatus.BusinessStatusId > 0)
            {
                var existingBusinessStatus = await _dbContext.BusinessStatus.FirstOrDefaultAsync(_ => _.BusinessStatusId == businessStatus.BusinessStatusId);

                existingBusinessStatus.Name     = businessStatus.Name;
                existingBusinessStatus.IsActive = businessStatus.IsActive;
            }
            else
            {
                var existingBusinessStatus = await _dbContext.BusinessStatus.FirstOrDefaultAsync(_ => _.Name == businessStatus.Name);

                if (existingBusinessStatus == null)
                {
                    _dbContext.BusinessStatus.Add(businessStatus);
                }
            }
            await _dbContext.SaveChangesAsync();
        }
示例#11
0
        private void OperationTest(object s, LoadEndEventArgs e, string currentUrl)
        {
            lock (lockobject) {
                LogManager.WriteLog("state={0},currentUrl={1}".With(state, currentUrl));
                foreach (var operation in opsList)
                {
                    if (operation.PerviousStatus == state && currentUrl.Contains(operation.CurrentUrl))
                    {
                        LogManager.WriteLog("{2} {0} 跳转到下一个状态 {1} {3} ".With(state, operation.NextStatus, operation.index, operation.note));

                        state = operation.NextStatus;
                        ovtimeTick.Next(operation, e);//计时器重新计时
                        //记录当前注册账号的状态
                        //LogManager.LogAccontStatus("|{0}".With(state.ToString()));
                        taskRunner.LogAccontStatus("|{0}".With(state.ToString()));// MouseKeyBordHelper.CurrentIP

                        if (operation.OperationHandler != null)
                        {
                            int timeCount = RandomManager.random.Next(2, 5) * 1000;
                            LogManager.WriteLog("随机休息{0}毫秒".With(timeCount));

                            //BeginInvoke(new Action(() => {
                            new Thread(() => {
                                Thread.Sleep(timeCount);
                                try {
                                    operation.OperationHandler.Invoke(operation, e);
                                } catch (Exception e2) {
                                    LogManager.WriteLog(e2.StackTrace + e2.ToString());
                                }
                            }).Start();
                            //}));
                        }
                        break;
                    }
                }
            }
        }
示例#12
0
        /// <summary>
        /// 转换成字符串
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CustomerID.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CustomerName, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", IdentityNo, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ProductType.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LoanCapital.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LoanPeriod.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LoanTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", BusinessStatus.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", StrBusinessStatus, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CLoanStatus.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", StrCLoanStatus, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LawsuitStatus.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", StrLawsuitStatus, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ContractNo, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", SavingCard, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", SavingUser, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LendingSideKey, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LendingSideID, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ServiceSideKey, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ServiceSideID, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", GuaranteeSideKey, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", GuaranteeSideID, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", OverAmount.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CurrentOverAmount.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", OtherAmount.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LoanKind, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LoanKindName, WebServiceConst.Separater_1);
            if (ToGuaranteeTime.HasValue)
            {
                sb.AppendFormat("{0}{1}", ToGuaranteeTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            }
            else
            {
                sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1);
            }

            if (ToLitigationTime.HasValue)
            {
                sb.AppendFormat("{0}{1}", ToLitigationTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            }
            else
            {
                sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1);
            }

            if (ClearLoanTime.HasValue)
            {
                sb.AppendFormat("{0}{1}", ClearLoanTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            }
            else
            {
                sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1);
            }
            sb.AppendFormat("{0}{1}", IsRepayment.ToString(), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", FrozenNo, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ProductKind, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", LatestTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", CapitalRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", DepositRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ProceduresRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ManagementRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", InterestRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", ServiceRate, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", BranchKey, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", BranchKeyName, WebServiceConst.Separater_1);
            sb.AppendFormat("{0}{1}", Region, WebServiceConst.Separater_1);
            sb.Append(RegionName);

            return(sb.ToString());
        }
示例#13
0
        //手机验证
        private void phoneVailed(BusinessStatus nowStatus)
        {
            //}

            //public void GetPhone2(object sender, EventArgs e) {
            //1.login


            string phoneNum = "";

            Application.DoEvents();
            //  lock (changeTel1) {
            bool getPhoneOK = false;
            bool isVcodeOk  = false;



            int TryPhoneNumTB = int.Parse(ConfigHelper.GetValue("TryPhoneNumTB"));

            if (ConfigHelper.GetValue("smsConfigtb") == "aima" || ConfigHelper.GetValue("smsConfigtb") == "jike")
            {
                GlobalVar.sms = IMySmsFactory.Build(ConfigHelper.GetValue("smsConfigtb"));
                GlobalVar.sms.GetConfigOfSms();//SmsConfigHelper.GetConfigOfSms();
            }

            for (int i = 0; i < TryPhoneNumTB; i++)
            {
                if (ConfigHelper.GetValue("smsConfigtb") == "both")
                {
                    GlobalVar.sms = IMySmsFactory.Build(i % 2 == 1 ? "jike" : "aima");
                    GlobalVar.sms.GetConfigOfSms();//SmsConfigHelper.GetConfigOfSms();
                }

                Thread.Sleep(1000);
                //2.1 检测是否当前已经通过手机验证

                if (MainForm.state != nowStatus)
                {
                    LogManager.WriteLog("当前不是获取手机号码 的页面了.");
                    break;
                }
                //2.2 获取手机
                getPhoneOK = SmsConfigHelper.GetPhone(ref phoneNum);
                if (!getPhoneOK)
                {
                    continue;
                }
                //getPhoneOK = true;
                //phoneNum = GlobalVar.phoneNum;
                //2.3 填充手机
                string js2run =
                    "document.getElementById('J_Mobile').value = '{0}';".With(phoneNum) +
                    "document.getElementById('J_BtnMobileCode').click();";

                LogManager.WriteLog(js2run);

                CefFrameHelper.ExcuteJs(MainCefFrame, js2run);
                LogManager.WriteLog("{0} is fill 填充手机 ".With(phoneNum));

                Application.DoEvents();

                //2.4 检测手机是否可用
                LogManager.WriteLog("检测手机是否可用");
                string valueOfStyle       = "";
                bool   is_valueOfStyle_ok = false;
                for (int j = 0; j < 2; j++)
                {
                    Thread.Sleep(3000);
                    valueOfStyle = CefFrameHelper.GetMsgByJs3(MainCefFrame, "document.getElementById('J_MsgMobileCode').getAttribute('class')");

                    LogManager.WriteLog("valueOfStyle:" + valueOfStyle);
                    is_valueOfStyle_ok = (valueOfStyle != null && valueOfStyle.Contains("ok"));
                    if (is_valueOfStyle_ok)
                    {
                        break;
                    }
                    Application.DoEvents();
                }
                if (!is_valueOfStyle_ok)
                {
                    LogManager.WriteLog("手机号码 {1} 不可用 释放并拉黑.重新获取,{0}".With(TryPhoneNumTB - i, phoneNum));
                    //释放单个手机
                    GlobalVar.sms.ReleasePhone(phoneNum, SmsServer.tb_reg_vode); // SmsApi.ReleasePhone(phoneNum, "2");
                    continue;
                }


                //2.5 手机可用则接收短信
                LogManager.WriteLog("手机号码 {0} 可用.".With(phoneNum));

                string vcodeNum = "";
                isVcodeOk = SmsConfigHelper.GetSmsOfPhoneTBREGV3_1(phoneNum, ref vcodeNum, SmsServer.tb_reg_vode);

                if (!isVcodeOk)
                {
                    LogManager.WriteLog("没有收到验证码,返回重新接收");
                    continue;
                }

                if (ConfigHelper.GetBoolValue("tbModelTest"))  //开启测试模式,记录手机号码并释放手机号码,跳转到支付宝注册
                {
                    GlobalVar.availabePhone = phoneNum;
                    GlobalVar.sms.ReleasePhone(phoneNum, SmsServer.tb_reg_login_vcode);
                    BT_Reg_zfb_Click(this, new EventArgs());
                }


                //2.6 接收到短信则提交
                //                document.getElementById('J_PhoneCheckCode').value='295768';
                //document.getElementsByClassName('btn-s')[0].click();

                string jsOfSubmitVcode =
                    "document.getElementById('J_MobileCode').value='{0}';".With(vcodeNum) +
                    "document.getElementById('J_BtnMobileCodeForm').click();" +
                    "document.getElementById('J_BtnMobileCodeForm').click();";
                //J_BtnMobileCodeForm
                //J_BtnMobileForm
                CefFrameHelper.ExcuteJs(MainCefFrame, jsOfSubmitVcode);//提交验证码
                if (GlobalVar.debug)
                {
                    LogManager.WriteLog(vcodeNum);
                    LogManager.WriteLog(jsOfSubmitVcode);
                }
                GlobalVar.phoneNum = phoneNum;
                break;
            }
            //     }).Start();
            //   };
        }
示例#14
0
        public async Task <ActionResult> AddBusinessStatus(BusinessStatus businessStatus)
        {
            await _masterService.AddUpdateBusinessStatus(businessStatus);

            return(Json(true, JsonRequestBehavior.AllowGet));
        }