示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            //Create xml to Post
            XmlDocument param = new XmlDocument();
            //Create xml to Collect
            XmlDocument resp = new XmlDocument();

            //Svc
            RAFClientDemo.RafProxy.RAFProxy rproxy = new RAFClientDemo.RafProxy.RAFProxy();
            param.LoadXml(rproxy.CustomerInsertParams().OuterXml);

            //Populate
            param.SelectSingleNode("/Params/Profile").Attributes["Value"].Value     = "1";
            param.SelectSingleNode("/Params/Password").Attributes["Value"].Value    = passphrase.Text;
            param.SelectSingleNode("/Params/Photo").Attributes["Value"].Value       = "";
            param.SelectSingleNode("/Params/FingerRight").Attributes["Value"].Value = "c2974e78fbfd1a134b2420bd0aaba573";
            param.SelectSingleNode("/Params/FingerLeft").Attributes["Value"].Value  = "c2974e78fbfd1a134b2420bd0aaba573";
            param.SelectSingleNode("/Params/IDNumber").Attributes["Value"].Value    = idNum.Text;
            param.SelectSingleNode("/Params/IDType").Attributes["Value"].Value      = ((System.Data.DataRowView)(idType.SelectedItem)).Row.ItemArray[0].ToString();
            param.SelectSingleNode("/Params/IDCountry").Attributes["Value"].Value   = ((System.Data.DataRowView)(issueCountry.SelectedItem)).Row.ItemArray[0].ToString();
            param.SelectSingleNode("/Params/FirstName").Attributes["Value"].Value   = tName1.Text;
            param.SelectSingleNode("/Params/MiddleName").Attributes["Value"].Value  = tName2.Text;
            param.SelectSingleNode("/Params/SurName1").Attributes["Value"].Value    = tSName1.Text;
            param.SelectSingleNode("/Params/SurName2").Attributes["Value"].Value    = tSName2.Text;
            param.SelectSingleNode("/Params/Suffix").Attributes["Value"].Value      = "";
            param.SelectSingleNode("/Params/Country").Attributes["Value"].Value     = ((System.Data.DataRowView)(issueCountry.SelectedItem)).Row.ItemArray[0].ToString();
            param.SelectSingleNode("/Params/Registrar").Attributes["Value"].Value   = "1";
            param.SelectSingleNode("/Params/CompanyName").Attributes["Value"].Value = compName.Text;

            resp.LoadXml(rproxy.CustomerInsert(param).OuterXml);

            Cursor.Current = Cursors.Default;

            if (resp.SelectSingleNode("/CustomerInsert/Status/ErrMsg").InnerText != "")
            {
                MessageBox.Show(resp.SelectSingleNode("/CustomerInsert/Status/ErrMsg").InnerText, "Error", MessageBoxButtons.OK);
            }
            else
            {
                newCustomerID = Convert.ToInt32(resp.SelectSingleNode("/CustomerInsert/CustomerID").InnerText);
            }


            clientInfo cliForm = new clientInfo(newCustomerID);

            cliForm.MdiParent = this.MdiParent;
            cliForm.Show();

            this.Close();
        }
示例#2
0
 private void dataGridResults_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int        custid  = (int)dataGridResults.Rows[e.RowIndex].Cells[0].Value;
         clientInfo cliForm = new clientInfo(custid);
         cliForm.FormClosed += new FormClosedEventHandler(clientInfo_FormClosed); //add handler to catch when CustInfo form is closed
         this.Hide();
         cliForm.MdiParent = this.MdiParent;
         cliForm.Show();
     }
     catch (Exception x)
     {
         log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
         log.Error(x.Message);
     }
 }