public void AddBodyRow(string id, params WebComponent[] cells) { WebRow row = new WebRow(cells.Select(o => new WebCell(o)).ToArray()); row.ID = id; if (null == this._tbody) { this._tbody = new WebTableBody(); this._children.Add(this._tbody); } this._tbody.Children.Add(row); }
/* public void SetHeaders( params WebComponent[] cells ) { * WebRow row = new WebRow(); * row.Children.AddRange( cells ); * this._headers = row; * } */ public void SetHeadRow(string id, params WebComponent[] cells) { WebRow row = new WebRow(cells.Select(o => new WebTableHeadCell(o)).ToArray()); row.ID = id; if (null == this._thead) { this._thead = new WebTableHead(row); this._children.Add(this._thead); } else { this._thead.Children.Clear(); this._thead.Children.Add(new WebTableHead(row)); } }
internal static WebControl GetWebControlFromIContol(IControl aControl, Browser aBrowser, Locator aLocator, ControlType aConrolType) { WebControl aWebControl = null; if (aConrolType == ControlType.Button) { WebButton aWebButton = new WebButton(aBrowser, aLocator); aWebButton.Control = aControl; aWebControl = aWebButton; } if (aConrolType == ControlType.EditBox) { WebEditBox aWebEditBox = new WebEditBox(aBrowser, aLocator); aWebEditBox.Control = aControl; aWebControl = aWebEditBox; } if (aConrolType == ControlType.Custom) { aWebControl = new WebControl(aBrowser, aLocator); aWebControl.Control = aControl; //aWebControl = aWebEditBox; } if (aConrolType == ControlType.Calender) { WebCalender aWebCalender = new WebCalender(aBrowser, aLocator); aWebCalender.Control = aControl; aWebControl = aWebCalender; } if (aConrolType == ControlType.ComboBox) { WebComboBox aWebComboBox = new WebComboBox(aBrowser, aLocator); aWebComboBox.Control = aControl; aWebControl = aWebComboBox; } if (aConrolType == ControlType.CheckBox) { WebCheckBox aWebCheckBox = new WebCheckBox(aBrowser, aLocator); aWebCheckBox.Control = aControl; aWebControl = aWebCheckBox; } if (aConrolType == ControlType.Dialog) { WebDialog aWebDialog = new WebDialog(aBrowser, aLocator); aWebDialog.Control = aControl; aWebControl = aWebDialog; } if (aConrolType == ControlType.Frame) { WebFrame aWebFrame = new WebFrame(aBrowser, aLocator); aWebFrame.Control = aControl; aWebControl = aWebFrame; } if (aConrolType == ControlType.Image) { WebImage aWebImage = new WebImage(aBrowser, aLocator); aWebImage.Control = aControl; aWebControl = aWebImage; } if (aConrolType == ControlType.Label) { WebLabel aWebLabel = new WebLabel(aBrowser, aLocator); aWebLabel.Control = aControl; aWebControl = aWebLabel; } if (aConrolType == ControlType.Link) { WebLink aWebLink = new WebLink(aBrowser, aLocator); aWebLink.Control = aControl; aWebControl = aWebLink; } if (aConrolType == ControlType.ListBox) { WebListBox aWebListBox = new WebListBox(aBrowser, aLocator); aWebListBox.Control = aControl; aWebControl = aWebListBox; } if (aConrolType == ControlType.Page) { WebPage aWebPage = new WebPage(aBrowser, aLocator); aWebPage.Control = aControl; aWebControl = aWebPage; } if (aConrolType == ControlType.RadioButton) { WebRadioButton aWebRadioButton = new WebRadioButton(aBrowser, aLocator); aWebRadioButton.Control = aControl; aWebControl = aWebRadioButton; } if (aConrolType == ControlType.SpanArea) { WebSpanArea aWebSpanArea = new WebSpanArea(aBrowser, aLocator); aWebSpanArea.Control = aControl; aWebControl = aWebSpanArea; } if (aConrolType == ControlType.WebTable) { WebTable aWebTable = new WebTable(aBrowser, aLocator); aWebTable.Control = aControl; aWebControl = aWebTable; } if (aConrolType == ControlType.WebRow) { WebRow aWebRow = new WebRow(aBrowser, aLocator); aWebRow.Control = aControl; aWebControl = aWebRow; } if (aConrolType == ControlType.WebCell) { WebCell aWebCell = new WebCell(aBrowser, aLocator); aWebCell.Control = aControl; aWebControl = aWebCell; } return(aWebControl); }
public WebTableHead(WebRow r) { this._tagname = "thead"; this._children.Add(r); }
public void Load_From_eStore() { DateTime FStartTime = DateTime.Now; Cursor OldCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; SslStatus.Text = "Loading Tokens from Shop.Alta.COM"; Refresh(); DateTime LastRecord = AM.GetLogTimestamp("EStoreTokenSync"); string Query = "SELECT P.id AS AssociatedTokenID, P.authnet_id AS CustomerPaymentProfileID, T.nprojno, T.nposno, T.nserialno, T.nunicodeno, " + "C.authnet_id AS AuthnetCustID, T.njournalno, I.axess_wtp AS WebID, I.person_firstname, I.person_lastname, T.created_at " + "FROM altashop.order_items AS I " + "INNER JOIN altashop.orders AS O ON O.id = I.order_id " + "INNER JOIN altashop.customers AS C ON O.customer_id = C.id " + "INNER JOIN altashop.customer_profiles AS P ON P.customer_id = C.id " + "INNER JOIN altashop.axess_transactions AS T ON I.id = T.order_item_id " + $"WHERE I.resort_card = 1 AND (C.deleted_at IS NULL OR P.deleted_at IS NULL) AND T.created_at >= '{LastRecord.ToString(Mirror.AxessDateTimeFormat)}' ORDER BY T.created_at"; using (DataTable WebSales2 = CF.LoadTable(SH.Shop_Alta_ComConn, Query, "WebSales2")) { pbLoadFromWeb.Maximum = WebSales2.Rows.Count; pbLoadFromWeb.Value = 0; foreach (DataRow WebRow in WebSales2.Rows) { pbLoadFromWeb.Value = WebSales2.Rows.IndexOf(WebRow) + 1; SslStatus.Text = $"Loading Token {pbLoadFromWeb.Value.ToString()} of {pbLoadFromWeb.Maximum.ToString()} from Shop.Alta.COM."; Refresh(); if (WebRow.Field <DateTime>("created_at") > LastRecord) { LastRecord = WebRow.Field <DateTime>("created_at"); } DataRow TokenXRow = CF.LoadDataRow(BUY.Buy_Alta_ComConn, $"SELECT * FROM axessutility.tokenxref WHERE projnr={WebRow["nprojno"].ToString()} AND posnr={WebRow["nposno"].ToString()} AND serialnr={WebRow["nserialno"].ToString()} AND nunicodenr={WebRow["nunicodeno"].ToString()}"); if (TokenXRow["serialnr"].ToString() == string.Empty) //empty record returned, no match found. { //insert new TokenXRef record DateTime CurTime = DateTime.Now; string TTime = CurTime.ToString(Mirror.AxessDateTimeFormat); Query = $"INSERT INTO axessutility.tokenxref (associatedTokenId, customerPaymentProfileId, orderId, projNr, posNr, serialNr, nunicodenr, " + $"authnet_custid, activeflag, journalNr, workPos, lastUpdated, firstname, lastname, dateInserted, webId, mediaID, WTP64) " + $"VALUES ({WebRow["associatedtokenid"].ToString()}, '{WebRow["customerpaymentprofileid"].ToString()}', " + $"'', {WebRow["nprojno"].ToString()}, {WebRow["nposno"].ToString()}, {WebRow["nserialno"].ToString()}, " + $"{WebRow["nunicodeno"].ToString()}, {WebRow["authnetcustid"].ToString()}, 1, {WebRow["njournalno"].ToString()}, 20, " + $"'{TTime}', '{CF.EscapeChar(WebRow["person_firstname"].ToString())}', '{CF.EscapeChar(WebRow["person_lastname"].ToString())}', '{TTime}', '{WebRow["webid"].ToString()}', '', '')"; CF.ExecuteSQL(BUY.Buy_Alta_ComConn, Query); } else { //Update salesdata record new token data string SerialKey = $"{WebRow["nposno"].ToString()}-{WebRow["nserialno"].ToString()}-{WebRow["nunicodeno"].ToString()}"; if (CF.RowExists(DW.dwConn, $"{DW.ActiveDatabase}.salesdata", $"serialkey='{SerialKey}' AND (tokenkey=0 OR pmtprofile=0 OR authnet_custid=0)")) { Query = $"UPDATE applications.salesdata SET tokenkey={TokenXRow["associatedtokenid"].ToString()}, pmtprofile = {TokenXRow["customerpaymentprofileid"].ToString()}, authnet_custid={TokenXRow["authnet_custid"].ToString()} WHERE serialkey = '{SerialKey}'"; CF.ExecuteSQL(DW.dwConn, Query); } } } } CF.ExecuteSQL(AM.MirrorConn, $"UPDATE {AM.ActiveDatabase}.tabLog SET LogNo='0',lastUpdate='{LastRecord.ToString(Mirror.AxessDateTimeFormat)}' WHERE TableName = 'EStoreTokenSync'"); TimeSpan ts = TimeSpan.FromTicks(DateTime.Now.Ticks - FStartTime.Ticks); lblLoadFromWeb.Text = string.Format($"{ts.Hours.ToString("0#")}:{ts.Minutes.ToString("0#")}:{ts.Seconds.ToString("0#")}"); lblLoadFromWeb.Visible = true; }