Ecolab.Pages.CustomerTabPage.AddCustomer C# (CSharp) Method

AddCustomer() public method

Adds the customer.
public AddCustomer ( string strID, string strName ) : void
strID string
strName string
return void
        public void AddCustomer(string strID, string strName)
        {
            MouseKeyBoardSimulator objKeyPress = new MouseKeyBoardSimulator();
            //objKeyPress.KeyPress(System.Windows.Forms.Keys.Tab);
            HtmlInputText ctrl_ID = GetHtmlControl<HtmlInputText>("CustomerID");
            MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
            ctrl_ID.Focus();
            ctrl_ID.InvokeEvent(ScriptEventType.OnClick);
            objKeyPress.SetNumeric(strID);
            MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
            HtmlInputText ctrl_Name = GetHtmlControl<HtmlInputText>("CustomerName");
            ctrl_Name.Focus();
            ctrl_Name.ExtendedMouseClick();
            objKeyPress.SetText(strName);
            MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
            Thread.Sleep(1000);
            Telerik.ActiveBrowser.RefreshDomTree();
            Thread.Sleep(5000);
            MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Enter);
        }