protected void BtnSubmit_Click(object sender, EventArgs e) { if (!CheckFields()) { return; } if (!Global.ConfirmLogin()) { Response.Write( "<script LANGUAGE='JavaScript' >alert('Something must have gone wrong. Please reload the page and try again. If you keep getting this message please contact Bidfood Pty Ltd.')</script>"); } var root = Server.MapPath("~"); //setting root path of server var path = Path.Combine(root, "XMLFiles\\Customer - External - new.xml"); // setting path and file to newuser XML var newUser = CherwellBusinessObject.FromXmlString(File.ReadAllText(path)); //Creating empty instance of object //Populating all required field in object newUser.FieldList.Fields[19].Value = txtPurchasersname.Text; newUser.FieldList.Fields[20].Value = ddlTypeOfBusiness.Text; newUser.FieldList.Fields[51].Value = Convert.ToString(chkLegalEntity.Checked); newUser.FieldList.Fields[1].Value = txtFirstName.Text; newUser.FieldList.Fields[2].Value = txtLastName.Text; newUser.FieldList.Fields[0].Value = txtFullName.Text; newUser.FieldList.Fields[5].Value = txtEmail.Text; newUser.FieldList.Fields[4].Value = txtPhone.Text; newUser.FieldList.Fields[11].Value = txtCellPhone.Text; newUser.FieldList.Fields[10].Value = txtfax.Text; var newRecordId = Details.CreateCherwellBusinessObject("Customer - External", newUser); // Creating new Customer Response.Redirect("~/BusinessDetails.aspx?RECID=" + newRecordId); // redirecting to next page }
protected void BtnAction_Click(object sender, EventArgs e) { if (!CheckField()) { return; } if (!Global.ConfirmLogin()) { Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=" + HttpContext.Current.Request.ApplicationPath); } RetrieveMembers(); var root = Server.MapPath("~"); var path = Path.Combine(root, "XMLFiles\\BusinessUnit.xml"); var xmlString = File.ReadAllText(path); var newBusinessUnit = CherwellBusinessObject.FromXmlString(xmlString); newBusinessUnit.FieldList.Fields[8].Value = txtName.Text; newBusinessUnit.FieldList.Fields[10].Value = txtStreetName.Text; newBusinessUnit.FieldList.Fields[11].Value = txtSuburb.Text; newBusinessUnit.FieldList.Fields[12].Value = txtBuildingNr.Text; newBusinessUnit.FieldList.Fields[13].Value = txtBuildingName.Text; newBusinessUnit.FieldList.Fields[14].Value = txtCity.Text; newBusinessUnit.FieldList.Fields[15].Value = ddlCountry.Text; newBusinessUnit.FieldList.Fields[16].Value = txtPostal.Text; newBusinessUnit.FieldList.Fields[17].Value = _newUserRecordId; if (btnAction.Text == "Add") { if (_businessUnits.Any(item => item.FieldList.Fields[8].Value == txtName.Text)) { Response.Write("<script LANGUAGE='JavaScript' >alert('You Cannot have multiple members with the same Name. Please review your input.')</script>"); return; } newBusinessUnit.FieldList.Fields[0].Value = Details.CreateCherwellBusinessObject("Customer Business Unit", newBusinessUnit); _businessUnits.Add(newBusinessUnit); } else { foreach (var item in _businessUnits) { if (lstUnits.SelectedItem.Text == item.FieldList.Fields[8].Value) { Details.UpdateDetails("Customer Business Unit", item.FieldList.Fields[0].Value, newBusinessUnit); } } } RetrieveMembers(); SetMemberDetails(); BtnClear_Click(null, null); }
protected void BtnAction_Click(object sender, EventArgs e) { if (!CheckField()) { return; } if (!Global.ConfirmLogin()) { Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=" + HttpContext.Current.Request.ApplicationPath); } var root = Server.MapPath("~"); var path = Path.Combine(root, "XMLFiles\\ShareHolders.xml"); var xmlString = File.ReadAllText(path); RetrieveMembers(); var newDirectorShareholder = CherwellBusinessObject.FromXmlString(xmlString); newDirectorShareholder.FieldList.Fields[8].Value = txtName.Text; newDirectorShareholder.FieldList.Fields[9].Value = txtCompany.Text; newDirectorShareholder.FieldList.Fields[10].Value = txtRegNo.Text; newDirectorShareholder.FieldList.Fields[11].Value = _newUserRecordId; if (btnAction.Text == "Add") { RetrieveMembers(); if (_shareHolders.Any(item => txtName.Text == item.FieldList.Fields[8].Value)) { Response.Write("<script LANGUAGE='JavaScript' >alert('You Cannot have multiple Director/Shareholders with the same Name. Please review your input.')</script>"); return; } newDirectorShareholder.FieldList.Fields[0].Value = Details.CreateCherwellBusinessObject("Director_Shareholder", newDirectorShareholder); _shareHolders.Add(newDirectorShareholder); } else { foreach (var item in _shareHolders) { if (lstMembers.SelectedItem.Text == item.FieldList.Fields[8].Value) { Details.UpdateDetails("Director_Shareholder", item.FieldList.Fields[0].Value, newDirectorShareholder); } } } BtnClear_Click(null, null); RetrieveMembers(); SetMemberDetails(); }
protected string CreateApplication() { if (!Global.ConfirmLogin()) { Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=" + HttpContext.Current.Request.ApplicationPath); } var root = Server.MapPath("~"); var path = Path.Combine(root, "XMLFiles\\BidfoodCreditApplication.xml"); var xmlString = File.ReadAllText(path); var newCreditApplication = CherwellBusinessObject.FromXmlString(xmlString); var incidentOwners = Details.GetListCherwellBusinessObjects("BFS_CreditApp_Branches", "Region", _newUser.FieldList.Fields[45].Value == "South Africa" ? _newUser.FieldList.Fields[48].Value : _newUser.FieldList.Fields[45].Value, "Record"); var actualIncidentOwner = new CherwellBusinessObject(); foreach (var item in incidentOwners) { if (item.FieldList.Fields[13].Value == "Default Financial Manager") { actualIncidentOwner = item; } } if (string.IsNullOrEmpty(actualIncidentOwner.Name)) { incidentOwners = Details.GetListCherwellBusinessObjects("BFS_CreditApp_Branches", "Branch", "Head Office", "Record"); foreach (var item in incidentOwners) { if (item.FieldList.Fields[9].Value == "Head Office") { actualIncidentOwner = item; } } } newCreditApplication.FieldList.Fields[0].Value = actualIncidentOwner.FieldList.Fields[14].Value; newCreditApplication.FieldList.Fields[1].Value = actualIncidentOwner.FieldList.Fields[15].Value; newCreditApplication.FieldList.Fields[2].Value = actualIncidentOwner.FieldList.Fields[16].Value; newCreditApplication.FieldList.Fields[3].Value = _newUser.FieldList.Fields[7].Value; newCreditApplication.FieldList.Fields[4].Value = _newUser.FieldList.Fields[0].Value; newCreditApplication.FieldList.Fields[5].Value = "Submitted"; newCreditApplication.FieldList.Fields[6].Value = txtCreditLimit.Text; newCreditApplication.FieldList.Fields[7].Value = chkCorrectAndAccurate.Checked.ToString(); newCreditApplication.FieldList.Fields[8].Value = chkTermsandConditions.Checked.ToString(); newCreditApplication.FieldList.Fields[9].Value = chkGaurantee.Checked.ToString(); newCreditApplication.FieldList.Fields[10].Value = chkAuthorisation.Checked.ToString(); newCreditApplication.FieldList.Fields[11].Value = "True"; newCreditApplication.FieldList.Fields[12].Value = ddlTerms.Text; return(Details.CreateCherwellBusinessObject("Bidfood Credit Application", newCreditApplication)); }
protected void CreateLiquorLicense() { if (!Global.ConfirmLogin()) { Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=" + HttpContext.Current.Request.ApplicationPath); } var root = Server.MapPath("~"); var path = Path.Combine(root, "XMLFiles\\LiquorLicense.xml"); var xmlString = File.ReadAllText(path); var newLiqourLicense = CherwellBusinessObject.FromXmlString(xmlString); var incidentOwners = Details.GetListCherwellBusinessObjects("BFS_CreditApp_Branches", "Region", _newUser.FieldList.Fields[45].Value == "South Africa" ? _newUser.FieldList.Fields[48].Value : _newUser.FieldList.Fields[45].Value, "Record"); var actualIncidentOwner = new CherwellBusinessObject(); foreach (var item in incidentOwners) { if (item.FieldList.Fields[13].Value == "Default Financial Manager") { actualIncidentOwner = item; } } if (string.IsNullOrEmpty(actualIncidentOwner.Name)) { incidentOwners = Details.GetListCherwellBusinessObjects("BFS_CreditApp_Branches", "Branch", "Head Office", "Record"); foreach (var item in incidentOwners) { if (item.FieldList.Fields[9].Value == "Head Office") { actualIncidentOwner = item; } } } newLiqourLicense.FieldList.Fields[4].Value = "Submitted"; newLiqourLicense.FieldList.Fields[0].Value = actualIncidentOwner.FieldList.Fields[14].Value; newLiqourLicense.FieldList.Fields[1].Value = actualIncidentOwner.FieldList.Fields[16].Value; newLiqourLicense.FieldList.Fields[2].Value = _newUser.FieldList.Fields[7].Value; newLiqourLicense.FieldList.Fields[3].Value = _newUser.FieldList.Fields[0].Value; newLiqourLicense.FieldList.Fields[5].Value = "False"; _excistingLiqourLicense = Details.CreateCherwellBusinessObject("Liquor License", newLiqourLicense); }
public static CherwellBusinessObject GetDetails(string busObj, string recId) { var businessObject = Global.CherwellConnection.GetBusinessObject(busObj, recId); return(CherwellBusinessObject.FromXmlString(businessObject)); }
protected void BtnAction_Click(object sender, EventArgs e) { if (!CheckField()) { return; } if (!Global.ConfirmLogin()) { Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=" + HttpContext.Current.Request.ApplicationPath); } var root = Server.MapPath("~"); var path = Path.Combine(root, "XMLFiles\\BusinessPartners.xml"); var xmlString = File.ReadAllText(path); var newBusinesMember = CherwellBusinessObject.FromXmlString(xmlString); RetrieveMembers(); newBusinesMember.FieldList.Fields[8].Value = txtName.Text; newBusinesMember.FieldList.Fields[9].Value = txtAddress.Text; newBusinesMember.FieldList.Fields[10].Value = ddlIdType.Text; if (ddlIdType.Text == "SA ID") { newBusinesMember.FieldList.Fields[11].Value = txtID.Text; } else { newBusinesMember.FieldList.Fields[12].Value = txtID.Text; } newBusinesMember.FieldList.Fields[14].Value = txtTel.Text; newBusinesMember.FieldList.Fields[15].Value = ddlCommunityOfProperty.Text == "Yes" ? "True" : "False"; newBusinesMember.FieldList.Fields[17].Value = _newUserRecordId; if (btnAction.Text == "Add") { if (_businessMembers.Any(item => txtName.Text == item.FieldList.Fields[8].Value)) { Response.Write( "<script LANGUAGE='JavaScript' >alert('You Cannot have multiple members with the same Name. Please review your input.')</script>"); return; } newBusinesMember.FieldList.Fields[0].Value = Details.CreateCherwellBusinessObject("Name of Business Member", newBusinesMember); _businessMembers.Add(newBusinesMember); } else { foreach (var current in _businessMembers) { if (lstMembers.SelectedItem.Text != current.FieldList.Fields[8].Value) { continue; } Details.UpdateDetails("Name of Business Member", current.FieldList.Fields[0].Value, newBusinesMember); break; } } RetrieveMembers(); SetMemberDetails(); BtnClear_Click(null, null); }