当前位置: 首页>>代码示例>>C#>>正文


C# HtmlDocument.GetElementById方法代码示例

本文整理汇总了C#中System.Windows.Forms.HtmlDocument.GetElementById方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlDocument.GetElementById方法的具体用法?C# HtmlDocument.GetElementById怎么用?C# HtmlDocument.GetElementById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.HtmlDocument的用法示例。


在下文中一共展示了HtmlDocument.GetElementById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScrapePage

        public void ScrapePage(HtmlDocument link)
        {
            CurrentDoc = link;

            TableData.Add(CurrentDoc.GetElementById("ctl00_cphBody_repeaterOwnerInformation_ctl00_lblOwnerName").InnerText);
            TableData.Add(CurrentDoc.GetElementById("ctl00_cphBody_lblHeaderPropertyAddress").InnerText);
            ScrapeHTMLTables("buildingsDetailWrapper", "table", 0);
            ScrapeHTMLTables("buildingsDetailWrapper", "table", 1);
            ScrapeHTMLTables("buildingsDetailWrapper", "table", 3);
            RemoveUnneededListElements();
        }
开发者ID:josecerejo,项目名称:PageScraper,代码行数:11,代码来源:COJScraper.cs

示例2: SetFileUpload

        protected void SetFileUpload(HtmlDocument document, string name, string fileName)
        {
            var fileElement = (HTMLInputElement)document.GetElementById(name).DomElement;

            fileElement.focus();

            // The first space is to open the file open dialog. The
            // remainder of the spaces is to have some messages for
            // until the open dialog actually opens.

            SendKeys.SendWait("       " + fileName + "{ENTER}");
        }
开发者ID:smile921,项目名称:hak_blog,代码行数:12,代码来源:WebBrowserFixtureBase.cs

示例3: ActionsBuilderWebView_DocumentCompleted

        private void ActionsBuilderWebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            // Set common properties (name, is scene or object, etc.)
            _document = ActionsBuilderWebView.Document;
            _document.GetElementById("ActionsBuilderObjectName").SetAttribute("value", _objectName);

            if (isRootNode)
                _document.InvokeScript("setIsScene");
            else
                _document.InvokeScript("setIsObject");

            _document.InvokeScript("updateObjectName");

            if (getProperty())
            {
                _document.GetElementById("ActionsBuilderJSON").SetAttribute("value", _jsonResult);
                _document.InvokeScript("updateGraphFromJSON");
            }

            // Set lists of meshes, lights, cameras etc.
            var gameScene = Loader.Global.IGameInterface;
            gameScene.InitialiseIGame(false);

            var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
            fillObjectsList(meshes, "setMeshesNames");

            var lights = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
            fillObjectsList(lights, "setLightsNames");

            var cameras = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
            fillObjectsList(cameras, "setCamerasNames");

            fillSoundsList(meshes, "setSoundsNames");

            // Need to subclass this, then allow 3ds Max usage 
            //Win32.SubClass(this.ActionsBuilderWebView.Handle);
        }
开发者ID:professorf,项目名称:Babylon.js,代码行数:37,代码来源:ActionsBuilderForm.cs

示例4: webBrowser1_DocumentCompleted

 private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
     {
         html = webBrowser1.Document;
         HtmlElement img = html.GetElementById("CodeImg");
         if (img == null)
             return;
         img.Style = "position:absolute;z-index:9999;top:0px;left:0px";
         Bitmap b = new Bitmap(img.ClientRectangle.Width, img.ClientRectangle.Height);
         webBrowser1.DrawToBitmap(b, new Rectangle(new Point(), img.ClientRectangle.Size));
         pictureBox1.Image = b;
         if (StateInfo.alart.Contains("密码"))
         {
             autoLogin = false;
             MessageBox.Show("密码错误", "提示");
             checkBox2.Checked = false;
             StateInfo.alart = "";
             button3_Click(sender, e);
         }
         else if (StateInfo.alart.Contains("验证码"))
         {
             autoLogin = false;
             MessageBox.Show("验证码错误", "提示");
             checkBox2.Checked = false;
             StateInfo.alart = "";
             button3_Click(sender, e);
             textBox1.Focus();
             textBox1.Text = "";
         }
         else if (StateInfo.alart == "click")
         {
             StateInfo.userID = comboBox1.Text;
             StateInfo.password = textBox2.Text;
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         modifyConf(this.comboBox1.Text, this.textBox2.Text);
     }
     if (webBrowser1.ReadyState == WebBrowserReadyState.Interactive)
     {
         //MessageBox.Show(StateInfo.alart, "Int");
     }
 }
开发者ID:rkasdf,项目名称:chinayanhuang,代码行数:44,代码来源:Login.cs

示例5: SimpleMultiCalc

 private static double? SimpleMultiCalc(HtmlDocument doc, string fieldId)
 {
     double? nullable3;
     double num2;
     double? nullable = 0.0;
     int num = 1;
     string str = fieldId.Remove(fieldId.Length - 1);
     HtmlElement elementById = doc.GetElementById(str + "_" + num.ToString());
     nullable = 0.0;
     if (elementById != null)
     {
         nullable = 1.0;
         do
         {
             try
             {
                 double? nullable4;
                 string str2 = elementById.GetAttribute("value").Trim();
                 LoggingService.DebugFormatted("{0}-{1}:{2}", new object[] { elementById.Id, elementById.GetAttribute("dbcolumn"), str2 });
                 if (elementById.GetAttribute("iskj") == "1")
                 {
                     if (!string.IsNullOrEmpty(str2))
                     {
                         LoggingService.DebugFormatted("计算扣减额", new object[0]);
                         nullable3 = nullable;
                         num2 = double.Parse(str2);
                         nullable = nullable3.HasValue ? new double?(nullable3.GetValueOrDefault() - num2) : ((double?) (nullable4 = null));
                     }
                 }
                 else
                 {
                     if ((str2 == null) || (str2.Length == 0))
                     {
                         nullable = 0.0;
                         break;
                     }
                     if (str2.EndsWith("%"))
                     {
                         nullable3 = nullable;
                         nullable = nullable3.HasValue ? new double?(nullable3.GetValueOrDefault() / 100.0) : ((double?) (nullable4 = null));
                         str2 = str2.Remove(str2.Length - 1);
                     }
                     nullable3 = nullable;
                     num2 = double.Parse(str2);
                     nullable = nullable3.HasValue ? new double?(nullable3.GetValueOrDefault() * num2) : ((double?) (nullable4 = null));
                 }
                 num++;
                 elementById = doc.GetElementById(str + "_" + num.ToString());
             }
             catch (Exception exception)
             {
                 LoggingService.Error(exception);
                 return null;
             }
         }
         while (elementById != null);
     }
     if ((doc.GetElementById(str + "_c") != null) && (doc.GetElementById(str + "_d") != null))
     {
         string str3 = doc.GetElementById(str + "_c").GetAttribute("value").Trim();
         string str4 = doc.GetElementById(str + "_d").GetAttribute("value").Trim();
         if ((((str3 != null) && (str3.Length != 0)) && (str4 != null)) && (str4.Length != 0))
         {
             nullable3 = nullable;
             num2 = double.Parse(doc.GetElementById(str + "_c").GetAttribute("value").Trim()) / double.Parse(doc.GetElementById(str + "_d").GetAttribute("value").Trim());
             nullable = nullable3.HasValue ? new double?(nullable3.GetValueOrDefault() * num2) : null;
         }
     }
     LoggingService.DebugFormatted("{0}:{1}", new object[] { doc.GetElementById(fieldId).GetAttribute("dbcolumn"), nullable });
     return nullable;
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:71,代码来源:WebBrowserExtensions.cs

示例6: SetHtmlElementValue

 private static void SetHtmlElementValue(HtmlDocument doc, DataSet ds, HtmlElement he, Dictionary<string, InvokeResult> invokes)
 {
     string attribute = he.GetAttribute("ref");
     if ((attribute != null) && (attribute.Trim().Length > 0))
     {
         HtmlElement elementById = doc.GetElementById(attribute);
         if (elementById != null)
         {
             double? nullable = HtmlElementCalc(doc, elementById, invokes);
             SetHtmlElementValue(he, nullable.HasValue ? MathHelper.Round(nullable.Value, 2).ToString("0.00") : string.Empty);
         }
     }
     else
     {
         string getdata = he.GetAttribute("getdata").Trim().Replace("\r", "").Replace("\n", "");
         if ((getdata != null) && (getdata.Length > 0))
         {
             SetHtmlElementValue(he, ParseGetData(doc, he.GetAttribute("dbcolumn"), ds, getdata, invokes));
         }
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:21,代码来源:WebBrowserExtensions.cs

示例7: button4_Click

        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                document = webBrowser1.Document;

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                btnElement = document.GetElementById("btn_Query");
                btn = (mshtml.HTMLInputElement)(btnElement.DomElement);

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptSelector.selectedIndex = 0;
                deptSelector.FireEvent("onchange");
                form.submit();

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                personSelector.selectedIndex = 0;

                //Application.DoEvents();

            }
            catch { }
        }
开发者ID:kidfruit,项目名称:WisdriContacts,代码行数:38,代码来源:ContactsWeb.cs

示例8: studyReserveBtn_Click

        /**********************************************************
         *
         *  예약 버튼
         *
         **********************************************************/
        private void studyReserveBtn_Click(object sender, EventArgs e)
        {
            doc = browser.Document as HtmlDocument;

            if (studyTimeBox.SelectedItem == null)
            {
                MessageBox.Show("사용할 시간을 선택해 주세요 :&", "Robot의 경고");
                return;
            }

            doc.GetElementById("ctl00_ContentPlaceHolder_ddusehour").SetAttribute("value", studyTimeBox.SelectedItem.ToString().Substring(0, 1));

            if (studyStudentId1.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_1").SetAttribute("value", studyStudentId1.Text);
            if (studyStudentId2.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_2").SetAttribute("value", studyStudentId2.Text);
            if (studyStudentId3.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_3").SetAttribute("value", studyStudentId3.Text);
            if (studyStudentId4.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_4").SetAttribute("value", studyStudentId4.Text);
            if (studyStudentId5.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_5").SetAttribute("value", studyStudentId5.Text);
            if (studyStudentId6.Text != "" && studyStudentId6.Enabled != false)
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_6").SetAttribute("value", studyStudentId6.Text);
            if (studyStudentId7.Text != "" && studyStudentId7.Enabled != false)
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_7").SetAttribute("value", studyStudentId7.Text);
            if (studyStudentId8.Text != "" && studyStudentId8.Enabled != false)
                doc.GetElementById("ctl00_ContentPlaceHolder_txtcompany_8").SetAttribute("value", studyStudentId8.Text);

            if (studyEtc.Text != "")
                doc.GetElementById("ctl00_ContentPlaceHolder_txtnote").SetAttribute("value", studyEtc.Text);

            HTMLDocument hdoc = doc.DomDocument as HTMLDocument;

            foreach (IHTMLElement hel in (IHTMLElementCollection)hdoc.body.all)
            {
                if (hel.getAttribute("id", 0) != null)
                {
                    if (hel.getAttribute("id", 0).ToString().IndexOf("ctl00_ContentPlaceHolder_btnSubmit") != -1)
                    {
                        // 예약 완료 or 미완료 메세지
                        hel.click();
                    }
                }
            }

            while (browser.ReadyState != WebBrowserReadyState.Complete)
            {
                Application.DoEvents();
            }

            if (browser.Url.ToString().IndexOf("Detail.aspx") == -1)
            {
                MessageBox.Show("입력한 값에 오류가 있습니다 :&", "Robot의 경고");
            }

            if (isLoading == true)
                return;

            studyDate.Text = DateTime.Now.Year.ToString() + "." + DateTime.Now.Month.ToString(dateFormat);

            loadStudyRoomStat(DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString(dateFormat));
        }
开发者ID:carpedm20,项目名称:UNIST-robot,代码行数:68,代码来源:MainForm.cs

示例9: LoginWithNamePassword

 private void LoginWithNamePassword(HtmlDocument doc)
 {
     HtmlElement ele;
     ele = doc.GetElementById("TPL_username_1");
     ele.SetAttribute("value", "username");
     ele = doc.GetElementById("TPL_password_1");
     ele.SetAttribute("value", "password");
     ele = doc.GetElementById("J_SubmitStatic");
     ele.InvokeMember("click");
 }
开发者ID:Extra001,项目名称:LoggingAccounting,代码行数:10,代码来源:CheckMoney.cs

示例10: LoginSupportedByWangWang

        private void LoginSupportedByWangWang(HtmlDocument doc)
        {
            HtmlElement ele1 = doc.GetElementById("J_Static2Quick");
            HtmlElement ele2 = doc.GetElementById("J_SubmitQuick");
            HtmlElement ele3 = doc.GetElementById("J_OtherAccountV"); //使用其他账户登录
            HtmlElement ele4 = doc.GetElementById("ra-0");

            string ss = string.Empty;
            ss += ele1 == null ? "false, " : "J_Static2Quick, ";
            ss += ele2 == null ? "false, " : "J_SubmitQuick, ";
            ss += ele3 == null ? "false, " : "J_OtherAccountV, ";
            ss += ele4 == null ? "false" : "ra-0";
            Console.Out.WriteLine(ss);

            HtmlElement ele = null;
            if (ele2 == null && ele3 == null)
            {
                ele = ele1;
            }
            else if (ele1 == null && ele3 == null)
            {
                ele = ele2;

                // Although WebBrowser.DocumentCompleted event risen
                // The entire page is not ready, maybe because of some AJAX content
                // Ignore in this case
                if(ele4 == null)
                {
                    ele = null;
                }
            }
            else if (ele1 == null && ele2 == null)
            {
                ele = ele3;
            }
            else
            {
                MessageBox.Show(ss);
            }

            if (ele != null)
            {
                ele.InvokeMember("click");
            }
        }
开发者ID:Extra001,项目名称:LoggingAccounting,代码行数:45,代码来源:CheckMoney.cs

示例11: CopyUserInfo

 private void CopyUserInfo(string[] dknames, HtmlDocument doc, string newvalue)
 {
     foreach (string str in dknames)
     {
         HtmlElement elementById = doc.GetElementById(str);
         if (elementById != null)
         {
             string str2 = string.IsNullOrEmpty(elementById.GetAttribute("value")) ? newvalue : (elementById.GetAttribute("value") + @"\" + newvalue);
             this.SetTableRowValue(elementById.GetAttribute("dbtable"), elementById.GetAttribute("dbcolumn"), 0, str2, new GetTableRowValueString(this.GetHtmlElementValue), elementById);
             this.SetElseWebBrowseHtmlElementValue(doc, elementById.Id, str2);
         }
         else
         {
             LoggingService.WarnFormatted("找不到控件:{0}", new object[] { str });
         }
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:17,代码来源:AbstractDataForm.cs

示例12: Process

        public override void Process(HtmlDocument doc)
        {
            Processed = true;

            if (MemberType == Type.TopCategory)
            {
                // get level 0 links
                foreach (HtmlElement el in doc.GetElementsByTagName("a"))
                {
                    if (el.GetAttribute("className") == "cat_t_linkto")
                    {
                        String name = el.InnerText;
                        String url = el.GetAttribute("href");
                        Children.Add(new Category(name, url, false));

                        // DEBUG!!!
                        break;

                    }
                }
            }
            else
            {
                // check sub categories

                HtmlElement div = null;
                foreach (HtmlElement x in doc.GetElementsByTagName("div"))
                {
                    if (x.GetAttribute("className") == "choose_subcategory")
                    {
                        div = x;
                        break;
                    }
                }

                if (div != null)
                {

                    int c = 0;

                    // process sub categories
                    foreach (HtmlElement a in div.GetElementsByTagName("a"))
                    {
                        String url = a.GetAttribute("href");
                        HtmlElementCollection nc = a.GetElementsByTagName("div");
                        String name = nc[0].InnerText;

                        // DEBUG!!!
                        if (c++ == 1)
                        {
                            Children.Add(new Category(name, url, false));
                            break;
                        }

                    }
                }
                else
                {
                    // process products
                    foreach (HtmlElement pd in doc.GetElementsByTagName("div"))
                    {
                        if (pd.GetAttribute("className") == "cop_title")
                        {
                            HtmlElement a = pd.GetElementsByTagName("a")[0];
                            String name = a.InnerText;
                            String url = a.GetAttribute("href");
                            Children.Add(new Leaf(name, url));

                            // DEBUG!!!
                            break;
                        }
                    }

                    // DEBUG!!!
                    //return;

                    // process paginator
                    HtmlElement paginator = doc.GetElementById("paginator1");

                    bool checkNext = false;

                    foreach (HtmlElement span in paginator.GetElementsByTagName("span"))
                    {
                        if (span.FirstChild.TagName.ToLower() == "strong")
                        {
                            checkNext = true;
                        }
                        else if (span.FirstChild.TagName.ToLower() == "a")
                        {
                            if (checkNext)
                            {
                                Processed = false;
                                Url = (new Uri(new Uri(Url), span.FirstChild.GetAttribute("href"))).ToString();
                                break;
                            }
                        }
                        else
                        {
                            throw new Exception("wwww");
                        }
//.........这里部分代码省略.........
开发者ID:Infarch,项目名称:MyPerlModules,代码行数:101,代码来源:Category.cs

示例13: webBrowser1_DocumentCompleted

        void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            document = this.webBrowser.Document;

            HtmlElement btnSubmit = document.GetElementById("btnSubmit");
            if (btnSubmit != null)
            {
                btnSubmit.Click += new HtmlElementEventHandler(btnSubmit_Click);
            }

            this.Cursor = Cursors.Default;
        }
开发者ID:HardCorePawn,项目名称:gMapMakerHCP,代码行数:12,代码来源:SelectMapArea.cs

示例14: ChangeData

        private void ChangeData(HtmlDocument doc, TicketOrder ticketOrder)
        {
            #region ��������Ϣ
            doc.GetElementById("tSendContactName").SetAttribute("value", ticketOrder.DeliverRecord.Contact_Name == null ? "" : ticketOrder.DeliverRecord.Contact_Name); //��ϵ��
            doc.GetElementById("tSendTel").SetAttribute("value", ticketOrder.DeliverRecord.Contact_Phone == null ? "" : ticketOrder.DeliverRecord.Contact_Phone); //��ϵ�˵绰
            doc.GetElementById("tSendMobile").SetAttribute("value", ticketOrder.DeliverRecord.Contact_Mobile == null ? "" : ticketOrder.DeliverRecord.Contact_Mobile); //��ϵ���ֻ�
            doc.GetElementById("tSendEmail").SetAttribute("value", ticketOrder.DeliverRecord.Contact_Email == null ? "" : ticketOrder.DeliverRecord.Contact_Email); //��ϵ���ʼ�
            doc.GetElementById("tSendAddress").SetAttribute("value", ticketOrder.DeliverRecord.Contact_Address == null ? "" : ticketOrder.DeliverRecord.Contact_Address); //��ϵ��ַ
            doc.GetElementById("tCustomerRemark").SetAttribute("value", ticketOrder.CustomerRemark == null ? "" : ticketOrder.CustomerRemark); //�ͻ�����Ҫ��
            doc.GetElementById("tCompanyRemark").SetAttribute("value", ticketOrder.CompanyRemark == null ? "" : ticketOrder.CompanyRemark); //��˾������ע

            doc.GetElementById("tSentDate").SetAttribute("value", ticketOrder.GetTicketTime == null ? "" : ticketOrder.GetTicketTime); //��Ʊʱ��
            doc.GetElementById("ddlOperDstSite").SetAttribute("value", ticketOrder.DstSite); //��Ʊ��
            string sIssueCityCode = TicketOrderAdmin.GetCityCodebyPartnerID(ticketOrder.DstSite);
            doc.GetElementById("ddlOperDstCity").SetAttribute("value", sIssueCityCode);  //������id
            //doc.GetElementById("ddlSendType").SetAttribute("value", ticketOrder.DeliverRecord.Deliver_Type_Id.ToString());//���ͷ�ʽ

            HtmlElementCollection elements = doc.GetElementById("ddlSendType").GetElementsByTagName("Option");
            foreach (HtmlElement el in elements)
            {
                if (el.GetAttribute("value") == ticketOrder.DeliverRecord.Deliver_Type_Id.ToString())
                {
                    el.SetAttribute("selected", "selected");
                }
            }

            if (ticketOrder.IsRemitSMS)
                doc.GetElementById("ckbRemitSMS").InvokeMember("click"); //�Ƿ������
            if (ticketOrder.IsNotShouldIssue)
                doc.GetElementById("ckbNotIssue").InvokeMember("click"); //�Ƿ���Ҫ��Ʊ
            if (ticketOrder.SendIndex == 0)
                doc.GetElementById("cbSendIndex").InvokeMember("click"); //�Ƿ���Ҫ�Ӽ�

            doc.GetElementById("txtUserFixMoney").SetAttribute("value", ticketOrder.MemberBalance.ToString() == null ? "" : ticketOrder.MemberBalance.ToString()); //�������տ�
            doc.GetElementById("txtArrearage").SetAttribute("value", ticketOrder.PayOweAmount.ToString() == null ? "" : ticketOrder.PayOweAmount.ToString()); //�������տ�

            doc.GetElementById("txtPayAmount").SetAttribute("value", ticketOrder.PayAmount.ToString());//֧�����
            doc.GetElementById("txtArrearage").SetAttribute("value", ticketOrder.PayOweAmount.ToString()); //֧��Ƿ��

            if (ticketOrder.Pay_Type == EnumDef.ETicketOrderPayType.��˾����֧��)
            {
                doc.GetElementById("rblPayType_0").InvokeMember("click");
                doc.GetElementById("ddlJSJPayType").SetAttribute("value", "4");
            }
            else if (ticketOrder.Pay_Type == EnumDef.ETicketOrderPayType.��˾�������п�)
            {
                doc.GetElementById("rblPayType_0").InvokeMember("click");
                doc.GetElementById("ddlJSJPayType").SetAttribute("value", "8");
                doc.GetElementById("ddlUnionPay").SetAttribute("value", (ticketOrder.IsUnionCard == EnumDef.ETicketOrderUnionPay.�� ? "1" : "2"));
            }
            else if (ticketOrder.Pay_Type == EnumDef.ETicketOrderPayType.��Ʊ�������ֽ�)
            {
                doc.GetElementById("rblPayType_1").InvokeMember("click");
                doc.GetElementById("ddlSelfPayType").SetAttribute("value", "1");
            }
            else if (ticketOrder.Pay_Type == EnumDef.ETicketOrderPayType.��Ʊ������ֽ�)
            {
                doc.GetElementById("rblPayType_2").InvokeMember("click");
                doc.GetElementById("ddlInsteadPayType").SetAttribute("value", "1");

                if (ticketOrder.TicketPayInfo != null)
                {
                    doc.GetElementById("ddlInsteadPartner").SetAttribute("value", ticketOrder.TicketPayInfo.GatherPartnerId.ToString());
                }

            }

            F_Debit_Payment_Record mobilePayRecord = new F_Debit_Payment_Record();
            if (mobilePayRecord.Load(order_Id, EnumDef.ESPOrderType.��Ʊ����))
            {
                doc.GetElementById("rblPayType_0").InvokeMember("click");
                if (mobilePayRecord.PaymentTypeId == EnumDef.ETMobliePay.��ǿ�֧��)
                {
                    doc.GetElementById("ddlJSJPayType").SetAttribute("value", "8");
                    doc.GetElementById("ddlUnionBank").SetAttribute("value", mobilePayRecord.BankcardTypeId.Value.ToString());
                    doc.GetElementById("txtUnionCardNO").SetAttribute("value", mobilePayRecord.CashcardNo.Trim());
                    doc.GetElementById("txtUnionPhone").SetAttribute("value", mobilePayRecord.CashcardMobi.Trim());
                }
                else if (mobilePayRecord.PaymentTypeId == EnumDef.ETMobliePay.���ÿ�֧��)
                {
                    doc.GetElementById("ddlJSJPayType").SetAttribute("value", "3");
                    doc.GetElementById("ddlCreditCardType").SetAttribute("value", mobilePayRecord.CreditcardType.Value.ToString());
                    doc.GetElementById("txtCreditCardNum").SetAttribute("value", mobilePayRecord.CreditcardNo.Trim());
                    doc.GetElementById("txtCreditCardDate").SetAttribute("value", mobilePayRecord.CreditcardAvail.Value.ToString("yyyy-MM-dd"));
                    doc.GetElementById("txtHandName").SetAttribute("value", mobilePayRecord.CreditcardOwner);
                    if (mobilePayRecord.CreditcardCvv2 != null && mobilePayRecord.CreditcardCvv2.Trim() != "")
                    {
                        HtmlElement element = doc.GetElementById("tCompanyRemark");
                        element.SetAttribute("value", element.GetAttribute("value") + "CVV" + mobilePayRecord.CreditcardCvv2);
                    }
                }
            }

            #endregion
        }
开发者ID:vinStar,项目名称:vin_zone_2009,代码行数:95,代码来源:HttplistenerHandler.cs

示例15: ChangeTicket

        private void ChangeTicket(HtmlDocument doc, TicketOrder ticketOrder)
        {
            HtmlElement element = doc.GetElementById("tTicketPrice");
            if (element != null)
            {
                string sql = "select * from t_to_order_tickets where order_id=" + order_Id + " and rownum<2";
                DataTable dt = DSCRM.DBA.GetDataTable(sql);

                double YPrice = Convert.ToInt32(dt.Rows[0]["FULL_PRICE"].ToString());
                doc.GetElementById("tTicketPrice100").SetAttribute("value", YPrice.ToString());//ȫ��

                //Ʊ��
                double enPrice = 10 * RoundFloat1(YPrice * 0.05, 0);
                double babyPrice = 10 * RoundFloat1(YPrice * 0.01, 0);
                element.SetAttribute("value", (ticketOrder.TicketPassengers[0].TicketPrice + "|" + enPrice + "|" + babyPrice));

                //�ۿ�
                doc.GetElementById("tRate").SetAttribute("value", ticketOrder.TicketPassengers[0].Rate.ToString() + "|50|10");
                //����
                doc.GetElementById("tAirportTax").SetAttribute("value", ticketOrder.TicketPassengers[0].AirPortTax.ToString() + "|0|0");
                //ȼ��
                double enFuelTax = GetInfFlueTax(ticketOrder.TicketPassengers[0].FuelTax);
                doc.GetElementById("tFuelTax").SetAttribute("value", ticketOrder.TicketPassengers[0].FuelTax.ToString() + "|" + enFuelTax + "|0");

                //Ԥ������
                element = doc.GetElementById("hidBookingParam");

                string hidStr = "<xml><Arguments><CommDefID>-1</CommDefID><CommisionRate>-1</CommisionRate><Discount>" + dt.Rows[0]["DISCOUNT"]
                     + "</Discount><TicketPrice>" + YPrice + "</TicketPrice><AirPortTax>"
                     + ticketOrder.TicketPassengers[0].AirPortTax + "</AirPortTax><FuelTax>"
                     + ticketOrder.TicketPassengers[0].FuelTax + "</FuelTax><IsSpecial>0</IsSpecial></Arguments></xml>";

                //����˿�
                string[] Passengers = doc.GetElementById("t_PassengerList").GetAttribute("value").Split(',');

                string NewPassengerList = "";

                for (int i = 0; i < Passengers.Length - 1; i++)
                {
                    string[] subGuest = Passengers[i].Split('|');
                    NewPassengerList += subGuest[0] + "|";
                    NewPassengerList += subGuest[1] + "|";
                    NewPassengerList += subGuest[2] + "|";
                    NewPassengerList += subGuest[3] + "|";
                    if (subGuest[2] == " ���� ")
                    {
                        NewPassengerList += ticketOrder.TicketPassengers[0].TicketPrice + "|";
                        NewPassengerList += ticketOrder.TicketPassengers[0].AirPortTax + "|";
                        NewPassengerList += ticketOrder.TicketPassengers[0].FuelTax + ",";
                    }
                    else if (subGuest[2] == " ��ͯ ")
                    {
                        NewPassengerList += enPrice + "|";
                        NewPassengerList += "0|";
                        NewPassengerList += enFuelTax + ",";
                    }
                    else if (subGuest[2] == " Ӥ�� ")
                    {
                        NewPassengerList += babyPrice + "|";
                        NewPassengerList += "0|";
                        NewPassengerList += "0,";
                    }
                }

                doc.GetElementById("t_PassengerList").SetAttribute("value", NewPassengerList);

                (doc.DomDocument as IHTMLDocument2).parentWindow.execScript("AutoPrice();", "javascript");
            }
        }
开发者ID:vinStar,项目名称:vin_zone_2009,代码行数:69,代码来源:HttplistenerHandler.cs


注:本文中的System.Windows.Forms.HtmlDocument.GetElementById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。