Inheritance: MonoBehaviour
        public string CreateNewEntity()
        {
            //Arrange
            Submit submit = new Submit()
                .AddValue("longitude", 100);
            var response = Factual.Submit("us-sandbox", submit, new Metadata().User("test_driver_user"));

            //Asert
            AssertReceivedOkResponse(response);
            dynamic newEntityjson = JsonConvert.DeserializeObject(response);
            var newEntityId = (string)newEntityjson.response.factual_id;
            return newEntityId;
        }
Beispiel #2
0
        public void AliPlay(ordersinfo os)
        {
            ////////////////////////////////////////////请求参数////////////////////////////////////////////


            //商户订单号,商户网站订单系统中唯一订单号,必填
            string out_trade_no = os.ID;

            //订单名称,必填
            string subject = os.OExtension;

            //付款金额,必填
            string total_fee = os.Money.ToString();

            //收银台页面上,商品展示的超链接,必填
            string show_url = "http://mp.weixin.qq.com/s/latm6ZXn2Hi6yCy8oWKa5Q";

            //商品描述,可空
            string body = "回馈众多Vip用户特权礼品,每人仅能领取一次!";



            ////////////////////////////////////////////////////////////////////////////////////////////////

            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", Config.partner);
            sParaTemp.Add("seller_id", Config.seller_id);
            sParaTemp.Add("_input_charset", Config.input_charset.ToLower());
            sParaTemp.Add("service", Config.service);
            sParaTemp.Add("payment_type", Config.payment_type);
            sParaTemp.Add("notify_url", Config.notify_url);
            sParaTemp.Add("return_url", Config.return_url);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("show_url", show_url);
            sParaTemp.Add("app_pay", "Y");//启用此参数可唤起钱包APP支付。
            sParaTemp.Add("body", body);
            //其他业务参数根据在线开发文档,添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.2Z6TSk&treeId=60&articleId=103693&docType=1
            //如sParaTemp.Add("参数名","参数值");

            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");

            Response.Write(sHtmlText);
        }
Beispiel #3
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Framework.jQuery.RegisterDnnJQueryPlugins(this.Page);
            Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
            ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Search/SearchSkinObjectPreview.css");
            ClientResourceManager.RegisterScript(Page, "~/Resources/Search/SearchSkinObjectPreview.js");


            cmdSearch.Click    += CmdSearchClick;
            cmdSearchNew.Click += CmdSearchNewClick;

            if (!Page.IsPostBack)
            {
                if (MinCharRequired == 0)
                {
                    MinCharRequired = 2;
                }
                if (AutoSearchDelayInMilliSecond == 0)
                {
                    AutoSearchDelayInMilliSecond = 400;
                }
                PortalId = PortalSettings.ActiveTab.IsSuperTab ? PortalSettings.PortalId : -1;

                if (!String.IsNullOrEmpty(Submit))
                {
                    if (Submit.IndexOf("src=", StringComparison.Ordinal) != -1)
                    {
                        Submit = Submit.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath);
                        Submit = Submit.Replace("src='", "src='" + PortalSettings.ActiveTab.SkinPath);
                    }
                }
                else
                {
                    Submit = Localization.GetString("Search", Localization.GetResourceFile(this, MyFileName));
                }
                cmdSearch.Text    = Submit;
                cmdSearchNew.Text = Submit;
                if (!String.IsNullOrEmpty(CssClass))
                {
                    WebRadioButton.CssClass  = CssClass;
                    SiteRadioButton.CssClass = CssClass;
                    cmdSearch.CssClass       = CssClass;
                    cmdSearchNew.CssClass    = CssClass;
                }
            }
        }
Beispiel #4
0
        public Units(char u, int i)
        {
            user = u;
            ID   = i;
            InitializeComponent();
            if (user == 'E')
            {
                ProjectApply.Enabled = false;
                Unit.Enabled         = false;
                Submit.Enabled       = false;
                MaxApplications.Hide();
            }
            else
            {
                DataTable C = controllerObj.CountCitApplicationsbyCitizen(ID);
                count = Convert.ToInt32(C.Rows[0][0]);
                MaxApplications.Text  = "Max. allowed active application and claimed units count = 3";
                YourApplications.Text = "Your active application and claimed units count =" + Convert.ToString(count);
            }
            DataTable dt = controllerObj.SelectAllUnits();

            dataGridView1.DataSource = dt;
            DataTable dp = controllerObj.GetAllProjectIDs();

            ProjectSort.DataSource    = dp;
            ProjectSort.DisplayMember = "ID";
            ProjectSort.ValueMember   = "ID";
            DataTable dC = controllerObj.SelectProjectCities();

            City.DataSource    = dC;
            City.DisplayMember = "City";
            City.ValueMember   = "City";

            for (int intCount = 0; intCount < dt.Rows.Count; intCount++)
            {
                var val = dt.Rows[intCount]["ProjectID"];

                if (!ProjectApply.Items.Contains(val))
                {
                    ProjectApply.Items.Add(val);
                }
            }
            Unit.Hide();
            LabelUnit.Hide();
            Submit.Hide();
            City.SelectedIndex        = -1;
            ProjectSort.SelectedIndex = -1;
        }
Beispiel #5
0
        protected void BtnAlipay_Click(object sender, EventArgs e)
        {
            ////////////////////////////////////////////请求参数////////////////////////////////////////////


            //商户订单号,商户网站订单系统中唯一订单号,必填
            string out_trade_no = WIDout_trade_no.Text.Trim();

            //订单名称,必填
            string subject = WIDsubject.Text.Trim();

            //付款金额,必填
            string total_fee = WIDtotal_fee.Text.Trim();

            //收银台页面上,商品展示的超链接,必填
            string show_url = WIDshow_url.Text.Trim();

            //商品描述,可空
            string body = WIDbody.Text.Trim();



            ////////////////////////////////////////////////////////////////////////////////////////////////

            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", Config.partner);
            sParaTemp.Add("seller_id", Config.seller_id);
            sParaTemp.Add("_input_charset", Config.input_charset.ToLower());
            sParaTemp.Add("service", Config.service);
            sParaTemp.Add("payment_type", Config.payment_type);
            sParaTemp.Add("notify_url", Config.notify_url);
            sParaTemp.Add("return_url", Config.return_url);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("show_url", show_url);
            //sParaTemp.Add("app_pay","Y");//启用此参数可唤起钱包APP支付。
            sParaTemp.Add("body", body);
            //其他业务参数根据在线开发文档,添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.2Z6TSk&treeId=60&articleId=103693&docType=1
            //如sParaTemp.Add("参数名","参数值");

            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");

            Response.Write(sHtmlText);
        }
Beispiel #6
0
        public UserViewModel(IScreen screen, User user, IUserRepository userRepository)
        {
            _userRepository = userRepository;
            HostScreen      = screen;
            // Commands
            var canSubmit = this.WhenAny(e => e.Code, code => code.Value.IsValid());

            Submit = ReactiveCommand.CreateFromTask(_ => userRepository.Submit(Model), canSubmit);
            Submit.Subscribe(result => MessageBox.Show(result ? "Success" : "Failure"));
            // Observe on UI thread
            Submit.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
            .Select(ex => new UserError("It will fail again, try anyway?", ex.Message))
            .SelectMany(UserError.Throw)
            .Subscribe(resolution =>
            {
                if (resolution == RecoveryOptionResult.RetryOperation)
                {
                    Submit.Execute();
                }
            });
            // Model subscription
            this.WhenAnyValue(e => e.Model).Where(e => e != null).Subscribe(model =>
            {
                Code  = model.Code;
                Group = model.Group;
            });
            Model = user;
            // Properties subscriptions
            this.WhenAnyValue(e => e.Group).Subscribe(group => Model.Group = group);
            this.WhenAnyValue(e => e.Code).Subscribe(code => Model.Code    = code);
            // Subscribe to error handle
            UserError.RegisterHandler(async error =>
            {
                // This shouldn't be a messagebox because is blocking the application, you must provide context and offer a resolution to the user not just showing "error"
                await Task.Delay(1);
                var message             = new StringBuilder();
                bool hasRecoveryOptions = error.ErrorCauseOrResolution.IsValid();
                if (hasRecoveryOptions)
                {
                    message.AppendLine(error.ErrorCauseOrResolution);
                }
                message.AppendLine(error.ErrorMessage);
                var result = MessageBox.Show(message.ToString(), "Alert!",
                                             hasRecoveryOptions ? MessageBoxButton.YesNo : MessageBoxButton.OK);

                return(hasRecoveryOptions && result == MessageBoxResult.Yes ?  RecoveryOptionResult.RetryOperation : RecoveryOptionResult.CancelOperation);
            });
        }
Beispiel #7
0
        //app支付,后台下单
        public JsonResult AliPay_APPPay(string total_fee = "1")
        {
            try
            {
                //商户订单号 System.DateTime.Now.ToString("yyyyMMddHHmmss") + "0000" + (new Random()).Next(1, 10000).ToString()

                //商户网站订单系统中唯一订单号,必填

                string out_trade_no = System.DateTime.Now.ToString("yyyyMMddHHmmss") + "0000" + (new Random()).Next(1, 10000).ToString();
                //把请求参数打包成数组
                SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();


                sParaTemp.Add("_input_charset", Com.Alipay.Config.input_charset.ToLower());
                sParaTemp.Add("body", "1");
                sParaTemp.Add("notify_url", Com.Alipay.Config.notify_url);
                sParaTemp.Add("out_trade_no", out_trade_no);
                sParaTemp.Add("partner", Com.Alipay.Config.partner);
                sParaTemp.Add("payment_type", Com.Alipay.Config.payment_type);
                sParaTemp.Add("seller_id", Com.Alipay.Config.seller_id);
                sParaTemp.Add("service", "mobile.securitypay.pay");
                sParaTemp.Add("subject", Com.Alipay.Config.subject);
                sParaTemp.Add("total_fee", total_fee.ToString());
                sParaTemp.Add("it_b_pay", "30m");
                sParaTemp.Add("return_url", "m.alipay.com");
                Encoding code = Encoding.GetEncoding(Com.Alipay.Config.input_charset);

                //待请求参数数组字符串
                string strRequestData = Submit.BuildRequestParaToString(sParaTemp, code);
                strRequestData = HttpUtility.UrlDecode(strRequestData, code);

                return(Json(new
                {
                    Data = strRequestData,
                    ResultCode = 0,
                    Msg = "下单成功"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    Data = "",
                    ResultCode = 1,
                    Msg = "下单异常:" + ex.Message
                }));
            }
        }
        public ActionResult Form_signing(FORM_IT_01Model fORM_IT_, string ApprovalButton)
        {
            Submit sb        = new Submit();
            bool   kq        = true;
            bool   kq2       = true;
            string sqlQuery  = "";
            string checkWait = "";

            if (fORM_IT_.AppContent == null)
            {
                fORM_IT_.AppContent = " ";
            }
            switch (ApprovalButton)
            {
            case "Approval":
                kq  = sb.f_insert_sub("通過", fORM_IT_.AppNo, fORM_IT_.AppContent);
                kq2 = sb.SigningApp(fORM_IT_.AppNo, "Approval");

                sqlQuery = @"select * from DATA_APP_ESIGN where APPNO='" + fORM_IT_.AppNo.Trim() + "' ;";
                DataTable dataTable = dbHelpers.DoSQLSelect(sqlQuery);
                checkWait = dataTable.Rows[0]["Checkwait"].ToString();
                SendMail sen = new SendMail();
                sen.insertSenmail(checkWait.Trim(), fORM_IT_.AppNo.Trim(), fORM_IT_.Title20, fORM_IT_.Title4Content.Trim(), "文件電子簽核申請單等待簽核");
                break;

            case "Reject":
                kq  = sb.f_insert_sub("駁回", fORM_IT_.AppNo, fORM_IT_.AppContent);
                kq2 = sb.SigningApp(fORM_IT_.AppNo, "Reject");

                sqlQuery = @"select * from DATA_APP_ESIGN where APPNO='" + fORM_IT_.AppNo.Trim() + "' ;";
                DataTable dataTable2 = dbHelpers.DoSQLSelect(sqlQuery);
                checkWait = dataTable2.Rows[0]["Checkwait"].ToString();
                SendMail sen2  = new SendMail();
                bool     kqsen = sen2.insertSenmail(checkWait.Trim(), fORM_IT_.AppNo.Trim(), fORM_IT_.Title20, fORM_IT_.Title4Content.Trim(), "文件電子簽核申請單被駁回");
                //string kqte = "";
                break;

            case "Submit":

                break;

            case "Delete":
                break;
            }


            return(RedirectToAction("Index", "APP_ESIGN"));
        }
Beispiel #9
0
        private void Search(string category)
        {
            JobFamilySelect.SelectByValue(category);

            Submit.Click();

            wait.Until(d => BrowseJobsHeader.Displayed);

            // check for most likely element, which in this case is a no results message
            if (ResultsMessage.Displayed)
            {
                driver.Close();

                Assert.Inconclusive("No results were shown");
            }
        }
Beispiel #10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            lgk.Model.tb_recharge rechargeInfo = rechargeBLL.GetModel(iRechargeID);

            if (rechargeInfo != null)
            {
                ////////////////////////////////////////////支付宝请求参数////////////////////////////////////////////

                //Response.Write("<script type='text/javascript'>alert('fasfaf');</script>");
                //支付类型
                string payment_type = "1";
                //必填,不能修改
                //服务器异步通知页面路径
                string notify_url = HttpContext.Current.Request.Url.Host + "/user/finance/notify_url.aspx";
                //需http://格式的完整路径,不能加?id=123这类自定义参数

                //页面跳转同步通知页面路径
                string return_url = HttpContext.Current.Request.Url.Host + "/user/finance/return_url.aspx";
                //需http://格式的完整路径,不能加?id=123这类自定义参数,不能写成http://localhost/

                //防钓鱼时间戳
                string anti_phishing_key = "";
                //若要使用请调用类文件submit中的query_timestamp函数

                //客户端的IP地址
                string exter_invoke_ip = "";
                //非局域网的外网IP地址,如:221.0.0.1
                ////////////////////////////////////////////////////////////////////////////////////////////////

                //把请求参数打包成数组
                SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();
                sParaTemp.Add("partner", Config.Partner);
                sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
                sParaTemp.Add("service", "create_direct_pay_by_user");
                sParaTemp.Add("RemitMoney", rechargeInfo.RechargeableMoney.ToString());
                sParaTemp.Add("out_trade_no", "会员充值");
                sParaTemp.Add("payment_type", payment_type);
                sParaTemp.Add("notify_url", notify_url);
                sParaTemp.Add("return_url", return_url);
                sParaTemp.Add("anti_phishing_key", anti_phishing_key);
                sParaTemp.Add("exter_invoke_ip", exter_invoke_ip);

                //建立请求
                string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");
                Response.Write(sHtmlText);
            }
        }
Beispiel #11
0
        private void Ok_Click(object sender, RoutedEventArgs e)
        {
            var submit            = new Submit();
            int DateIntOfCleaning = DateOfCleaning.DayOfYear;

            submit.WhenDone = DateOfCleaning.DayOfYear;
            submit.Executer = user;
            submit.Checker  = checker;

            if (Wash.IsChecked == true)
            {
                submit.Wash = true;
            }
            else
            {
                submit.Wash = false;
            }

            if (Sweep.IsChecked == true)
            {
                submit.Sweep = true;
            }
            else
            {
                submit.Sweep = false;
            }

            if (Trash.IsChecked == true)
            {
                submit.Trash = true;
            }
            else
            {
                submit.Trash = false;
            }

            if (submit.Wash == false && submit.Trash == false && submit.Sweep == false)
            {
                MessageBox.Show("Please, change reason!");
                return;
            }

            submitRepository.AddSubmit(submit);
            submitRepository.Save();

            Close();
        }
Beispiel #12
0
        /// <summary>
        /// 会员卡提现
        /// </summary>
        /// <param name="withdrawNo">提现流水号,要求唯一性 </param>
        /// <param name="cardId">卡号 </param>
        /// <param name="money">提现金额</param>
        /// <returns></returns>
        /// <remarks>2017-02-08 杨浩 创建</remarks>
        public override Result VipCardWithdraw(string withdrawNo, int cardId, decimal money)
        {
            var result    = new Result();
            var sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner_id", config.Partner);
            sParaTemp.Add("charset_name", config.Charset_name.ToLower());
            sParaTemp.Add("sign_type", config.Sign_type);

            sParaTemp.Add("withdraw_no", withdrawNo);
            sParaTemp.Add("card_id", cardId.ToString());
            sParaTemp.Add("money", money.ToString());
            sParaTemp.Add("notify_url", "http://xrc.com/QianDaiVipCard/VipCardWithdrawNotify");

            string responsestr = new Submit().BuildRequest(sParaTemp, "vipCard/withdraw");

            if (responsestr.StartsWith("报错:"))
            {
                result.StatusCode = 1;
                result.Message    = responsestr;
                return(result);
            }

            var back = JObject.Parse(responsestr);

            if (back["ret_code"].ToString() != "0")
            {
                result.StatusCode = 3;
                result.Message    = back["ret_message"].ToString() + "-" + money.ToString();
            }
            else
            {
                var qianDaiVipCardWithdrawLog = new CrQianDaiVipCardWithdrawLog()
                {
                    WithdrawNo = withdrawNo,
                    CardId     = cardId,
                    Money      = money,
                    CreateDate = DateTime.Now,
                    CreatedBy  = BLL.Authentication.AdminAuthenticationBo.Instance.Current.Base.SysNo,
                    Status     = "-2",
                };

                QianDaiVipCardWithdrawLogBo.Instance.CreateCrQianDaiVipCardWithdrawLog(qianDaiVipCardWithdrawLog);
            }

            return(result);
        }
        /// <summary>
        /// 支付宝分润公共方法
        /// </summary>
        /// <param name="out_bill_no">该次分润的分润号,必填,保证其唯一性</param>
        /// <param name="out_trade_no">商户订单号,商户网站已经付款完成的商户网站订单号,out_trade_no、trade_no须至少填写一项</param>
        /// <param name="trade_no">支付宝交易号,已经付款完成的支付宝交易号,与商户网站订单号out_trade_no相对应</param>
        /// <param name="royalty_parameters">提成信息集,必填,格式设置参见接口技术文档</param>
        /// <returns>返回分润结果JSON字符串</returns>
        public string SubmitDistribute(string out_bill_no, string out_trade_no, string trade_no, string royalty_parameters)
        {
            BaseService.WriteLog("分润公共方法SubmitDistribute()");

            BaseService.WriteLog("把请求参数打包成数组");
            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", Config.Partner);
            sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
            sParaTemp.Add("service", "distribute_royalty");
            sParaTemp.Add("out_bill_no", out_bill_no);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("trade_no", trade_no);
            sParaTemp.Add("royalty_type", "10");
            sParaTemp.Add("royalty_parameters", royalty_parameters);

            BaseService.WriteLog("建立请求,以模拟远程HTTP的POST请求方式构造并获取支付宝的处理结果");
            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp);

            RespData    respData = new RespData();
            XmlDocument xmlDoc   = new XmlDocument();

            try
            {
                xmlDoc.LoadXml(sHtmlText);

                string is_success = xmlDoc.SelectSingleNode("/alipay/is_success").InnerText;
                if (!is_success.Equals("T"))
                {
                    string error = xmlDoc.SelectSingleNode("/alipay/error").InnerText;
                    respData.Code        = "F";
                    respData.Description = "操作失败";
                    respData.Exception   = error;
                }
            }
            catch (Exception exp)
            {
                respData.Code        = "F";
                respData.Description = "操作失败";
                respData.Exception   = exp.ToString();
            }

            return(respData.ToJSON());
        }
Beispiel #14
0
        public async Task <Evaluation> Submit(Guid profileId, Guid chapterId, int pageIndex, string solution)
        {
            var profile = await _profiles.Get(profileId, UserId);

            var submit     = new Submit(chapterId, pageIndex, solution);
            var evaluation = await _evaluator.Evaluate(profile, submit);

            if (!profile.Equals(evaluation.Profile))
            {
                var cachedId = profile.Id.ToString();

                _cache.Remove(cachedId);
                _cache.Add(cachedId, profile);
            }

            return(evaluation);
        }
Beispiel #15
0
        private void DoSendMsg(List <Model.SubmitRequest> argSendSmss)
        {
            Submit        vSubmitBll;
            SubmitResp    vSubmitResp;
            StringBuilder vResultMsg = new StringBuilder();

            foreach (Model.SubmitRequest item in argSendSmss)
            {
                vSubmitBll = new Submit(item);
                vSubmitBll.FillBodyBytes();
                vSubmitBll.Write(_Socket);
                vSubmitResp = (SubmitResp)vSubmitBll.Read(_Socket);
                string vResultTemp = Help.ResultCode.ContainsKey(vSubmitResp.Result) ? Help.ResultCode[vSubmitResp.Result] : "unknow error";
                vResultMsg.Append(item.UserNumber + ":" + vResultTemp + "|");
            }
            _Result = vResultMsg.ToString();
        }
Beispiel #16
0
        public void Hotel_Room_Add()
        {
            LoginAsAdmin();

            AddHotel(out string name).
            Hotels.Rows[x => x.Name == name].Should.BeVisible();
            Go.To <RoomsPage>().
            Add().
            HotelName.Set(name).
            RoomType.Set("Double or Twin Rooms").
            RoomDescription.SetRandom().
            Price.SetRandom(out int price).
            Submit.Click();
            Go.To <RoomsPage>().
            Rooms.Rows.FirstOrDefault().Price.Should.Equal(price.ToString()).
            Rooms.Rows.FirstOrDefault().Hotel.Should.Equal(name);
        }
        /* driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon")).Click();
         * {
         *   var element = driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon"));
         *   Actions builder = new Actions(driver);
         * builder.DoubleClick(element).Perform();
         * } */



        public void RegistrationPage()
        {
            CommonUtils cookieIgnore = new CommonUtils(driver);

            cookieIgnore.RejectAll_Cookies();

            SignIn_Page.Click();


            Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL);

            userEmail.getCellData("SPP_TestData", true);
            Email_Text.SendKeys(Env.Email_Id);
            Password_Text.SendKeys("Test@123");

            WebDriverWait wait = new WebDriverWait(driver, System.TimeSpan.FromSeconds(800));

            Thread.Sleep(800);
            Submit.Click();


            dropdown_NCS.Click();
            NCS_Tab.Click();

            RetrieveCHICK.Click();

            Excel_Suite     childDataExcel = new Excel_Suite(Env.EXCEL_TEST_CHILD_DATA);
            ChildAward_Data ChildData      = childDataExcel.GetChildDetails(Env.EXCEL_TEST_CHILD_DATA);


            Eyp_firstname.SendKeys(ChildData.ChildFirstName);
            Eyp_lastname.SendKeys(ChildData.ChildLastName);

            DateOfBirth.SendKeys(ChildData.DateOfBirth);
            Eyp_chic.SendKeys(ChildData.ChildIdentifierCode);

            NextButton.Click();

            StartDate.SendKeys("");

            EndDate.SendKeys("");

            NextButton.Click();

            Claimedhours.SendKeys("4");
        }
Beispiel #18
0
        public void ProcessRequest(HttpContext context)
        {
            string userId = context.Request.Form["user[id]"];
            string money  = context.Request.Form["ctb[money]"];
            //DONE: 支付宝充值
            //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓以下支付宝↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
            ////////////////////////////////////////////请求参数////////////////////////////////////////////
            //商户订单号,商户网站订单系统中唯一订单号,必填
            string out_trade_no = Guid.NewGuid().ToString();
            //订单名称,必填
            string subject = "身家充值";
            //付款金额,必填
            string total_fee = string.Format("{0:0.00}", money?.Split(',')[0]);
            //商品描述,可空
            string body = "身家充值";

            ////////////////////////////////////////////////////////////////////////////////////////////////

            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("service", Config.service);
            sParaTemp.Add("partner", Config.partner);
            sParaTemp.Add("seller_id", Config.seller_id);
            sParaTemp.Add("_input_charset", Config.input_charset.ToLower());
            sParaTemp.Add("payment_type", Config.payment_type);
            sParaTemp.Add("notify_url", Config.notify_url);
            sParaTemp.Add("return_url", Config.return_url);
            sParaTemp.Add("anti_phishing_key", Config.anti_phishing_key);
            sParaTemp.Add("exter_invoke_ip", Config.exter_invoke_ip);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("body", body);
            sParaTemp.Add("extra_common_param", userId);
            //其他业务参数根据在线开发文档,添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.O9yorI&treeId=62&articleId=103740&docType=1
            //如sParaTemp.Add("参数名","参数值");

            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp, "post", "确认");

            context.Response.ContentType = "text/html";
            context.Response.Charset     = "utf-8";
            context.Response.Write(sHtmlText);
        }
Beispiel #19
0
    protected void BtnAlipay_Click(object sender, EventArgs e)
    {
        ////////////////////////////////////////////请求参数////////////////////////////////////////////

        //支付宝交易号
        string trade_no = WIDtrade_no.Text.Trim();
        //支付宝交易号与商户订单号不能同时为空

        //商户订单号
        string out_order_no = WIDout_order_no.Text.Trim();


        ////////////////////////////////////////////////////////////////////////////////////////////////

        //把请求参数打包成数组
        SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

        sParaTemp.Add("partner", Config.Partner);
        sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
        sParaTemp.Add("service", "close_trade");
        sParaTemp.Add("trade_no", trade_no);
        sParaTemp.Add("out_order_no", out_order_no);

        //建立请求
        string sHtmlText = Submit.BuildRequest(sParaTemp);

        //请在这里加上商户的业务逻辑程序代码

        //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——

        XmlDocument xmlDoc = new XmlDocument();

        try
        {
            xmlDoc.LoadXml(sHtmlText);
            string strXmlResponse = xmlDoc.SelectSingleNode("/alipay").InnerText;
            Response.Write(strXmlResponse);
        }
        catch (Exception exp)
        {
            Response.Write(sHtmlText);
        }

        //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
    }
Beispiel #20
0
        private void GetOpenId()
        {
            string _Code = Request.QueryString["code"];

            if (string.IsNullOrEmpty(_Code))
            {
                string url = string.Format(POSTCODEURL + "?appid={0}&redirect_uri={1}&response_type=code&scope={2}#wechat_redirect", WeChatConfig.AppId, HttpUtility.UrlEncode(Request.Url.AbsoluteUri), SCOPE);
                Response.Redirect(url);
            }
            else
            {
                string  url    = string.Format(POSTTOKENURL + "?appid={0}&secret={1}&code={2}&grant_type=authorization_code", WeChatConfig.AppId, WeChatConfig.AppSecret, _Code);
                string  str    = Submit.HttpGet(url);
                JObject json   = JObject.Parse(str);
                string  OpenId = json["openid"].ToString();
                Session["OpenIdE"] = OpenId;
            }
        }
Beispiel #21
0
        public ActionResult ReSubmit(int submitId)
        {
            using (BaseRepository <Submit> _repo = new BaseRepository <Submit>())
            {
                var _user = SessionSet <User> .Get("login");

                var    twId   = _repo.Query <Submit>().FirstOrDefault(x => x.Id == submitId);
                Submit submit = new Submit
                {
                    Body     = twId.Body,
                    UserId   = _user.Id,
                    UserName = twId.UserName,
                    ParentId = submitId
                };
                _repo.Add(submit);
                return(Json(new { result = true, JsonRequestBehavior.AllowGet }));
            }
        }
Beispiel #22
0
        public void AddSubmit(Submit sub)
        {
            using (var context = new Context())
            {
                var submit = new Submit()
                {
                    Sweep    = sub.Sweep,
                    Wash     = sub.Wash,
                    Trash    = sub.Trash,
                    WhenDone = sub.WhenDone,
                    Executer = context.Users.Single(x => x.Id == sub.Executer.Id),
                    Checker  = context.Users.Single(x => x.Id == sub.Checker.Id)
                };

                context.Submits.Add(submit);
                context.SaveChanges();
            }
        }
Beispiel #23
0
        public ActionResult getPhoto(Customer newCustomer)
        {
            db.Customers.Add(newCustomer);
            db.SaveChanges();

            Customer searchCustomer = db.Customers.Where(item => item.Name.Equals(newCustomer.Name) && item.Phone.Equals(newCustomer.Phone) && item.Address.Equals(newCustomer.Address)).First();
            Submit   newSubmit      = new Submit();

            newSubmit.Entity1ID = searchCustomer.CustomerID;
            newSubmit.Entity2ID = newCustomer.IDExam;
            newSubmit.Type      = "Customer-Exam";
            newSubmit.time      = DateTime.Now;

            db.Submits.Add(newSubmit);
            db.SaveChanges();

            return(Content("Success"));
        }
Beispiel #24
0
        // GET: Submits/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Submit submit = db.Submits.Find(id);

            if (submit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.cv_id     = new SelectList(db.Cvs, "cv_id", "cv_fullname", submit.cv_id);
            ViewBag.submit_id = new SelectList(db.Users, "user_id", "user_login", submit.submit_id);
            ViewBag.work_id   = new SelectList(db.Works, "work_id", "work_name", submit.work_id);
            ViewBag.user_id   = new SelectList(db.Users, "user_id", "user_login", submit.user_id);
            return(View(submit));
        }
Beispiel #25
0
        public InputModal(string title, string actionText, string defaultValue, Submit submitCallback)
        {
            submit = submitCallback;
            input  = new TextBox("input", 200.0f, defaultValue);

            Component = new Wrapper(UiKeys.Modal.Key, new Container("container", Direction.Vertical,
                                                                    new List <IWidget> {
                new Label("title", title, 16.0f),
                input,
                new Container("actions", Direction.Horizonal, new List <IWidget> {
                    new Button(UiKeys.Modal.Cancel, "Cancel", 95.0f, ButtonStyle.Dismiss),
                    new Button(UiKeys.Modal.Submit, actionText, 95.0f, ButtonStyle.Action),
                }, 0.0f, 10.0f)
            }, 20.0f, 10.0f
                                                                    ));

            Ui.State.Focused = input;
        }
Beispiel #26
0
 private void form4_Load(object sender, EventArgs e)
 {
     name.Hide();
     contact.Hide();
     password.Hide();
     password2.Hide();
     address.Hide();
     gender.Hide();
     mail.Hide();
     date.Hide();
     comboBox1.Items.Clear();
     comboBox1.Items.Add("Select One");
     comboBox1.SelectedIndex      = 0;
     dateTimePicker1.Format       = DateTimePickerFormat.Custom;
     dateTimePicker1.CustomFormat = "ddd   dd, MMMM, yyyy";
     dateTimePicker1.Value        = DateTime.Now;
     Submit.Focus();
 }
Beispiel #27
0
        protected void btnPayNow_Click(object sender, EventArgs e)
        {
            //假支付环节
            //调试支付时,请去掉一下两行代码的注释
            //string resultURL = "payresultfromAlipay4.aspx?id=" + soSysNo + "&total_fee=5745.60";

            //Response.Redirect(resultURL);

            //业务参数赋值;
            string out_trade_no = lblSOSysNo.Text.Trim();
            string subject      = lblSOID.Text;         //subject		商品名称
            string body         = lblSOID.Text;         //Request.QueryString["miaos"];T_body.Text;		//body			商品描述
            string payment_type = "1";                  //支付类型
            string total_fee    = lblSOAmt.Text.Trim(); // Request.QueryString["prices"]; T_total_fee.Text;                      //总金额					0.01~50000.00
            string show_url     = YoeJoyConfig.SiteBaseURL;
            string notify_url   = String.Concat(YoeJoyConfig.SiteBaseURL, YoeJoyConfig.AlipayNotifyURL);
            string return_url   = String.Concat(YoeJoyConfig.SiteBaseURL, YoeJoyConfig.AlipayReturnURL);
            string seller_email = YoeJoyConfig.AlipaySellerEmailAddress;
            //string anti_phishing_key = Submit.Query_timestamp();
            string anti_phishing_key = String.Empty;
            string exter_invoke_ip   = String.Empty;

            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", Config.Partner);
            sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
            sParaTemp.Add("service", "create_direct_pay_by_user");
            sParaTemp.Add("payment_type", payment_type);
            sParaTemp.Add("notify_url", notify_url);
            sParaTemp.Add("return_url", return_url);
            sParaTemp.Add("seller_email", seller_email);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("body", body);
            sParaTemp.Add("show_url", show_url);
            sParaTemp.Add("anti_phishing_key", anti_phishing_key);
            sParaTemp.Add("exter_invoke_ip", exter_invoke_ip);

            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");

            Response.Write(sHtmlText);
        }
Beispiel #28
0
    protected void BtnAlipay_Click(object sender, EventArgs e)
    {
        ////////////////////////////////////////////请求参数////////////////////////////////////////////

        //服务器异步通知页面路径
        string notify_url = "http://www.xxx.com/refund_fastpay_by_platform_pwd-CSHARP-UTF-8/notify_url.aspx";
        //需http://格式的完整路径,不允许加?id=123这类自定义参数

        //退款当天日期
        string refund_date = WIDrefund_date.Text.Trim();
        //必填,格式:年[4位]-月[2位]-日[2位] 小时[2位 24小时制]:分[2位]:秒[2位],如:2007-10-01 13:13:13

        //批次号
        string batch_no = WIDbatch_no.Text.Trim();
        //必填,格式:当天日期[8位]+序列号[3至24位],如:201008010000001

        //退款笔数
        string batch_num = WIDbatch_num.Text.Trim();
        //必填,参数detail_data的值中,“#”字符出现的数量加1,最大支持1000笔(即“#”字符出现的数量999个)

        //退款详细数据
        string detail_data = WIDdetail_data.Text.Trim();
        //必填,具体格式请参见接口技术文档


        ////////////////////////////////////////////////////////////////////////////////////////////////

        //把请求参数打包成数组
        SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

        sParaTemp.Add("partner", Config.Partner);
        sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
        sParaTemp.Add("service", "refund_fastpay_by_platform_pwd");
        sParaTemp.Add("notify_url", notify_url);
        sParaTemp.Add("refund_date", refund_date);
        sParaTemp.Add("batch_no", batch_no);
        sParaTemp.Add("batch_num", batch_num);
        sParaTemp.Add("detail_data", detail_data);

        //建立请求
        string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认");

        Response.Write(sHtmlText);
    }
Beispiel #29
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // load dnn.jquery library for customising radiobutton
            DotNetNuke.Framework.jQuery.RegisterDnnJQueryPlugins(this.Page);

            cmdSearch.Click    += cmdSearch_Click;
            cmdSearchNew.Click += cmdSearchNew_Click;

            if (!Page.IsPostBack)
            {
                ClientAPI.RegisterKeyCapture(txtSearch, cmdSearch, 13);
                ClientAPI.RegisterKeyCapture(txtSearchNew, cmdSearchNew, 13);

                if (!String.IsNullOrEmpty(Submit))
                {
                    if (Submit.IndexOf("src=") != -1)
                    {
                        Submit = Submit.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath);
                        Submit = Submit.Replace("src='", "src='" + PortalSettings.ActiveTab.SkinPath);
                    }
                }
                else
                {
                    Submit = Localization.GetString("Search", Localization.GetResourceFile(this, MyFileName));
                }
                cmdSearch.Text    = Submit;
                cmdSearchNew.Text = Submit;
                if (!String.IsNullOrEmpty(CssClass))
                {
                    WebRadioButton.CssClass  = CssClass;
                    SiteRadioButton.CssClass = CssClass;
                    cmdSearch.CssClass       = CssClass;
                    cmdSearchNew.CssClass    = CssClass;
                }

                if (Request.QueryString["Search"] != null)
                {
                    txtSearch.Text    = Request.QueryString["Search"];
                    txtSearchNew.Text = Request.QueryString["Search"];
                }
            }
        }
Beispiel #30
0
        public void Commit(Submit submit)
        {
            try
            {
                submitLocker.EnterWriteLock();

                var deliver = new Deliver
                {
                    SPNumber       = submit.SPNumber,
                    UserNumber     = submit.UserNumber,
                    MessageCoding  = MessageCodes.GBK,
                    MessageContent = submit.MessageContent,
                    TP_pid         = 0,
                    TP_udhi        = 0
                };
                //添加到转发消息队列
                submitQueue.Enqueue(deliver);
                //映射序列号
                smscHandler.MapSequeue(deliver.SequenceNumberString, submit.SequenceNumberString);

                //添加发送报告添加到数据库
                var mReport = new MReport
                {
                    TargetSubmitSequenceNumber = submit.SequenceNumber,
                    SubmitSequenceNumber       = submit.SequenceNumberString,
                    UserNumber = deliver.UserNumber,
                    SPNumber   = deliver.SPNumber,
                    ReportType = (int)ReportTypes.PerSubmit,
                    ErrorCode  = 0,
                    State      = (int)ReportStatus.Wait,
                    Status     = 0,
                    Created    = DateTime.Now
                };
                StorageProvider <ReportStorage> .GetStorage().Insert(mReport);
            }
            catch
            {
                throw;
            }
            finally
            {
                submitLocker.ExitWriteLock();
            }
        }
Beispiel #31
0
        public override IBaseScreenView SubmitForm()
        {
            Submit.Wait(5).Click();
            if ((this.PageNames == PageNames.TestItemStandardPopup) ||
                (this.PageNames == PageNames.CreateNewItem) ||
                (this.PageNames == PageNames.EditTestItem) ||
                (this.PageNames == PageNames.EditTask) ||
                (this.PageNames == PageNames.EditQuestion) ||
                (this.PageNames == PageNames.EditRubric))
            {
                //switch to window
                DriverCommands.WaitToSwitchWindow(_currentWindow, 5);
            }
            //pause the script for a few seconds to let the page settle down
            System.Threading.Thread.Sleep(5000);

            //workaround for "*No standard(s) selected" after trying to select a standard
            try
            {
                if (NoStandardSelectedLabel.Wait(5).Displayed)
                {
                    SelectFirstStandardTreeInGroup();
                    Submit.Wait(5).Click();
                    if ((this.PageNames == PageNames.TestItemStandardPopup) ||
                        (this.PageNames == PageNames.CreateNewItem) ||
                        (this.PageNames == PageNames.EditTestItem) ||
                        (this.PageNames == PageNames.EditTask) ||
                        (this.PageNames == PageNames.EditQuestion) ||
                        (this.PageNames == PageNames.EditRubric))
                    {
                        //switch to window
                        DriverCommands.WaitToSwitchWindow(_currentWindow, 5);
                    }
                    //pause the script for a few seconds to let the page settle down
                    System.Threading.Thread.Sleep(5000);
                }
            }
            catch (Exception e)
            {
                //do nothing
            }

            return(ReturnSubmitPage());
        }
Beispiel #32
0
        private Submit CreateSubmitFromEntity(e.Submit eSubmit)
        {
            if (eSubmit == null)
            {
                return null;
            }

            Submit result = new Submit()
            {
                Id = eSubmit.Id,
                FileName = eSubmit.FileName,
                FileContents = eSubmit.FileContents,
                Data = eSubmit.Data,
                IsProcessed = eSubmit.IsProcessed,
                Status = eSubmit.Status,
                SubmitDate = eSubmit.SubmitDate,
                StatusDate = eSubmit.StatusDate,
                Team = CreateTeamFromEntity(eSubmit.Team),
                ProcessingDetails = eSubmit.ProcessingDetails,
                SecondsSinceEnrollment = eSubmit.SecondsSinceEnrollment,
                AssignmentEnrollment = CreateAssignmentEnrollmentFromEntity(eSubmit.AssignmentEnrollment),
                TournamentAssignment = CreateTournamentAssignmentFromEntity(eSubmit.TournamentAssignment)
            };

            return result;
        }
Beispiel #33
0
        private e.Submit CreateEntityFromSubmit(Submit s)
        {
            if (s == null)
            {
                return null;

            }
            e.Submit result = e.Submit.CreateSubmit(s.Id, s.SubmitDate, s.Status, s.SecondsSinceEnrollment, s.IsProcessed, s.ProcessingDetails, s.FileName, s.FileContents, s.Data, s.StatusDate);

            result.AssignmentEnrollmentReference.Value = (from ae in _m.AssignmentEnrollment
                                                          where ae.Id == s.AssignmentEnrollment.Id
                                                          select ae).First();
            result.TournamentAssignmentReference.Value = (from ta in _m.TournamentAssignment
                                                          where ta.Id == s.TournamentAssignment.Id
                                                          select ta).First();
            result.TeamReference.Value = (from t in _m.Team
                                          where t.Id == s.Team.Id
                                          select t).First();
            return result;
        }
Beispiel #34
0
        public Submit SaveSubmit(Submit submit)
        {
            e.Submit toSave = CreateEntityFromSubmit(submit);

            _m.AddToSubmit(toSave);
            _m.SaveChanges();
            _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toSave);

            submit.Id = toSave.Id;

            return submit;
        }
Beispiel #35
0
 /// <summary>
 /// There are no comments for Submit in the schema.
 /// </summary>
 public void AddToSubmit(Submit submit)
 {
     base.AddObject("Submit", submit);
 }
Beispiel #36
0
        public void TeamSubmit_SelectAddSelectDeleteSelect_OK()
        {
            using (System.Transactions.TransactionScope updateTransaction =
                    new System.Transactions.TransactionScope())
            {
                string connectionString = GetConnectionstring();
                DataAccess d2 = new DataAccess(connectionString);

                Team team = new Team();
                team.ID = -1;
                team.TeamName = "blabla";
                team.TeamMembers = "asdf";
                team.Password = "******";
                team.IsAdmin = false;
                d2.SaveTeam(team);

                Tournament t = new Tournament();
                t.Id = -1;
                t.Name = "TESTING";
                d2.SaveTournament(t);

                Assignment a = new Assignment();
                a.AssignmentId = -1;
                a.AssignmentName = "ASSIGNMENT";
                d2.SaveAssignment(a);

                TournamentAssignment ta = new TournamentAssignment();
                ta.TournamentAssignmentId = -1;
                ta.TournamentId = t.Id;
                ta.AssignmentId = a.AssignmentId;
                ta.AssignmentOrder = 1;
                ta.Points1 = 100;
                ta.Points2 = 50;
                ta.Points3 = 25;
                ta.Active = false;
                d2.SaveTournamentAssignment(ta);

                TeamTournamentAssignment tta = new TeamTournamentAssignment();
                tta.TeamTournamentAssignmentId = -1;
                tta.TeamId = team.ID;
                tta.TournamentAssignmentId = ta.TournamentAssignmentId;
                d2.SaveTeamTournamentAssignment(tta);

                Submit submit = new Submit();
                submit.ID = -1;
                submit.TeamTournamentAssignmentId = (int)tta.TeamTournamentAssignmentId;
                submit.TeamId = team.ID;
                byte[] uploadstream = new byte[2] {1,2};
                submit.UploadStream = uploadstream;
                submit.FileName = "somename.cs";
                d2.InsertTeamSubmit(submit);

                Assert.AreNotEqual(submit.ID, -1);

                List<Submit> submits = d2.GetTeamSubmitsForAssignment(submit.TeamTournamentAssignmentId);

                Assert.AreEqual(submits.Count, 1);

                //getbyid
                Submit byId = d2.GetTeamSubmitById(submit.ID);

                Assert.AreEqual(byId.ID,submit.ID);

                d2.DeleteTeamSubmit(submit.ID);

                List<Submit> submitsAfterDelete = d2.GetTeamSubmitsForAssignment(submit.TeamTournamentAssignmentId);

                Assert.AreEqual(0, submitsAfterDelete.Count);

            }
        }
        public void SubmitQueryMatchesRawTest()
        {
            Submit submit = new Submit();

            submit.AddValue("name", "McDenny’s");
            submit.AddValue("address", "1 Main St.");
            submit.AddValue("locality", "Bedrock");
            submit.AddValue("region", "BC");

            //Assert

            Assert.AreEqual("values={\"name\":\"McDenny’s\",\"address\":\"1 Main St.\",\"locality\":\"Bedrock\",\"region\":\"BC\"}", HttpUtility.UrlDecode(submit.ToUrlQuery()));
        }
        public void TestSubmitEdit()
        {
            var newEntityId = CreateNewEntity();

            //Arrange
            Submit submit = new Submit()
                .AddValue("longitude", 101);
            var response = Factual.Submit("us-sandbox", newEntityId, submit, new Metadata().User("test_driver_user"));

            //Asert
            AssertReceivedOkResponse(response);
            dynamic json = JsonConvert.DeserializeObject(response);
            Assert.IsFalse((bool)json.response.new_entity);
        }
        public void SubmitAddTestCase2()
        {
            //Arrange
            Submit values = new Submit();

            values.AddValue("name", "Starbucks");
            values.AddValue("address", "72 Spring St");
            values.AddValue("locality", "New York");
            values.AddValue("region", "NY");
            values.AddValue("postcode", "10012");
            values.AddValue("country", "US");

            //Act
            Metadata metadata = new Metadata().User("test_driver_user");
            var response = Factual.Submit("us-sandbox", values, metadata);

            //Assert
            AssertReceivedOkResponse(response);
        }
        //[Test] per Aaron: Factual doesn't check if id already exists, so it does not result in an error.
        public void TestSubmitError()
        {
            //Arrange
            Submit submit = new Submit()
                .RemoveValue("longitude");

            var exception = Assert.Throws<FactualApiException>(
                () => Factual.Submit("us-sandbox", "randomwrongid", submit, new Metadata().User("test_driver_user")));
            //Asert
            Assert.IsNotNull(exception);
        }
        public void TestSubmitError()
        {
            // Arrange
            Submit submit = new Submit().RemoveValue("longitude");

            // Act
            var response = Factual.Submit("us-sandbox", "randomwrongid", submit, new Metadata().User("test_driver_user"));

            // Assert
            AssertReceivedOkResponse(response);
        }
Beispiel #42
0
 /// <summary>
 /// Create a new Submit object.
 /// </summary>
 /// <param name="id">Initial value of Id.</param>
 /// <param name="submitDate">Initial value of SubmitDate.</param>
 /// <param name="status">Initial value of Status.</param>
 /// <param name="secondsSinceEnrollment">Initial value of SecondsSinceEnrollment.</param>
 /// <param name="isProcessed">Initial value of IsProcessed.</param>
 /// <param name="processingDetails">Initial value of ProcessingDetails.</param>
 /// <param name="fileName">Initial value of FileName.</param>
 /// <param name="fileContents">Initial value of FileContents.</param>
 /// <param name="data">Initial value of Data.</param>
 public static Submit CreateSubmit(int id, global::System.DateTime submitDate, string status, long secondsSinceEnrollment, bool isProcessed, string processingDetails, string fileName, string fileContents, byte[] data)
 {
     Submit submit = new Submit();
     submit.Id = id;
     submit.SubmitDate = submitDate;
     submit.Status = status;
     submit.SecondsSinceEnrollment = secondsSinceEnrollment;
     submit.IsProcessed = isProcessed;
     submit.ProcessingDetails = processingDetails;
     submit.FileName = fileName;
     submit.FileContents = fileContents;
     submit.Data = data;
     return submit;
 }