Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId     = Request.QueryString["RECID"];
            Page.EnableViewState = true;
            if (!Global.ConfirmLogin())
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=CreditAct.aspx");
                return;
            }
            _newUser = new CherwellBusinessObject();

            if (string.IsNullOrEmpty(_newUserRecordId))
            {
                Response.Redirect(Global.Redirect);
            }
            _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
            if (IsPostBack)
            {
                return;
            }
            if (_newUser.FieldList.Fields[122].Value == "True")
            {
                Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
            }
            btnDelete.Visible = false;
            GetCustomerdetails();
            DdlCreditAct_SelectedIndexChanged(null, null);
            RetrieveMembers();
            SetMemberDetails();
        }
        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 Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId     = Request.QueryString["RECID"];
            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();


                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                if (IsPostBack)
                {
                    return;
                }

                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                SetControlDetails();
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=AssetValueAndTurnover.aspx");
            }
        }
Пример #4
0
        private bool CheckDetails(CherwellBusinessObject checkUser)
        {
            if (!Isnumber(txtReg1.Text) || !Isnumber(txtReg2.Text) || !Isnumber(txtReg3.Text))
            {
                Response.Write(
                    "<script LANGUAGE='JavaScript' >alert('Your company registration number can only contain numbers. Please change your registration number accordingly.')</script>");
                return(false);
            }

            if (!Isnumber(txtvatNumber.Text))
            {
                Response.Write(
                    "<script LANGUAGE='JavaScript' >alert('Your VAT can only contain numbers. Please Change your VAT Number accordingly.')</script>");
                return(false);
            }
            if (bool.Parse(_newUser.FieldList.Fields[117].Value))
            {
                var dnumber = txtReg1.Text;
                if (dnumber.Length > 4)
                {
                    Response.Write(
                        "<script LANGUAGE='JavaScript' >alert('Your company registration is to long. Please change your registration number accordingly.')</script>");
                    return(false);
                }
            }
            if (bool.Parse(_newUser.FieldList.Fields[117].Value))
            {
                var dnumber = txtReg2.Text;
                if (dnumber.Length > 7)
                {
                    Response.Write(
                        "<script LANGUAGE='JavaScript' >alert('Your company registration is to long. Please change your registration number accordingly.')</script>");
                    return(false);
                }
            }
            if (bool.Parse(_newUser.FieldList.Fields[117].Value))
            {
                var dnumber = txtReg3.Text;
                if (dnumber.Length > 2)
                {
                    Response.Write(
                        "<script LANGUAGE='JavaScript' >alert('Your company registrationis to long. Please change your registration number accordingly.')</script>");
                    return(false);
                }
            }



            if (!chkPremisesLeased.Checked || !string.IsNullOrEmpty(txtLandlordDetails.Text))
            {
                return(true);
            }
            Response.Write(
                "<script LANGUAGE='JavaScript' >alert('Please fill in your landlord details as this is mandatory when you are leasing the premises.')</script>");
            return(false);
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId     = Request.QueryString["RECID"];
            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                if (IsPostBack)
                {
                    return;
                }

                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("/BidfoodCreditApplication/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                chkCorrectAndAccurate.Visible = true;
                chkCorrectAndAccurate.Checked = false;
                chkTermsandConditions.Visible = false;
                chkTermsandConditions.Checked = false;
                chkAuthorisation.Visible      = false;
                chkAuthorisation.Checked      = false;
                chkGaurantee.Visible          = false;
                chkGaurantee.Checked          = false;
                btnSubmit.Visible             = false;
                chkCorrectAndAccurate.Text    = string.Concat("I ", _newUser.FieldList.Fields[9].Value, " ",
                                                              _newUser.FieldList.Fields[11].Value,
                                                              " confirm that all information provided is correct and accurate.");
                chkTermsandConditions.Text = string.Concat("I ", _newUser.FieldList.Fields[9].Value, " ",
                                                           _newUser.FieldList.Fields[11].Value,
                                                           " confirm that I have read, understood and agree with the standard terms and Conditions.");
                chkGaurantee.Text = string.Concat("I ", _newUser.FieldList.Fields[9].Value, " ",
                                                  _newUser.FieldList.Fields[11].Value,
                                                  " confirm that I have read, understood and agree with the Gaurantee.");
                chkAuthorisation.Text = string.Concat("I ", _newUser.FieldList.Fields[9].Value, " ",
                                                      _newUser.FieldList.Fields[11].Value,
                                                      " confirm that I am authorised to allow  Bidfood  to do such credit rating processes as deemed necessary to evaluate this application");
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=ConfirmationAndSubmit.aspx");
            }
        }
Пример #6
0
        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 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);
        }
Пример #8
0
        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));
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();

            _newUserRecordId = base.Request.QueryString["RECID"];

            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }

                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                if (base.IsPostBack)
                {
                    return;
                }

                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }
                var year = DateTime.Today.Year;
                ddlYear?.Items.Clear();
                for (var i = year; i >= 1900; i--)
                {
                    ddlYear?.Items.Add(i.ToString());
                }
                if (ddlYear != null)
                {
                    ddlYear.Items.FindByValue("2000").Selected = true;
                }
                GetCustomerdetails();
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=FinancialDetails.aspx");
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId     = Request.QueryString["RECID"];
            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                var recId = Request.QueryString["REFID"];
                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                if (IsPostBack)
                {
                    return;
                }

                var stringBuilder          = new StringBuilder();
                var cherwellBusinessObject = Details.GetDetails("Bidfood Credit Application", recId);
                stringBuilder.Append("Dear " + _newUser.FieldList.Fields[9].Value + ",\n");
                stringBuilder.Append("\n");
                stringBuilder.Append(
                    "Thank you for completing the online registration form for Bidfood’s Credit Application.\n");
                stringBuilder.Append(
                    "By now you should have received an e-mail containing your reference number to the application.\n");
                stringBuilder.Append(cherwellBusinessObject.FieldList.Fields[45].Value + "\n\n");
                stringBuilder.Append(
                    "You can use this e-mail in the event you would like to add or disclose any other information that might be of value to the application.\n");
                stringBuilder.Append(
                    "When replying please make sure that you keep the reference number in the subject line so that it can be identified and added to the correct application.\n");
                stringBuilder.Append("\n");
                stringBuilder.Append("Thank you for your patience and understanding,\n");
                stringBuilder.Append("Bidfood Pty Ltd\n");
                txtcompleted.Text = stringBuilder.ToString();
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=ApplicationTicketNumber.aspx");
            }
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId = Request.QueryString["RECID"];

            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }

                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);

                var excistingLicense = Details.GetListCherwellBusinessObjects("Liquor License", "Customer ID", _newUserRecordId, "Record");
                if (excistingLicense != null && excistingLicense.Count > 0)
                {
                    foreach (var item in excistingLicense)
                    {
                        _excistingLiqourLicense = item.FieldList.Fields[0].Value;
                        break;
                    }
                }
                if (IsPostBack)
                {
                    return;
                }
                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                chkPurchaseYes.Checked = !string.IsNullOrEmpty(_excistingLiqourLicense);
                chkPurchaseYes_CheckedChanged(null, null);
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=PurchaseLiquor.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.EnableViewState = true;
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();

            _newUserRecordId = Request.QueryString["RECID"]; //setting recordIf from URL
            if (Global.ConfirmLogin())                       // Check for Cherwell Webservices connection
            {
                _newUser = new CherwellBusinessObject();     //New instance of Cherwell Object by Reference

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);                                 // If recordId is empty then redirect to new Customer
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId); // Getting current user details
                if (IsPostBack)
                {
                    return;             // if ostback then do not reset user details
                }
                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                var typeOfBusiness =
                    Details.GetListCherwellBusinessObjects("Type of Business", "Status", "Active", "Record");
                ddlTypeOfBusiness.Items.Clear();     // clear current list
                ddlTypeOfBusiness.Items.Add("");     // Add empty item

                foreach (var item in typeOfBusiness) //loop through list of type of business and add them to the list
                {
                    ddlTypeOfBusiness.Items.Add(item.FieldList.Fields[8].Value);
                }

                SetControlDetails();                       // Call method
                chkLegalEntity_CheckedChanged(null, null); //Call method
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=ContactDetails.aspx"); //If connection fails got fail page
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();
            _newUserRecordId = Request.QueryString["RECID"]; //setting recordIf from URL

            Page.EnableViewState = true;
            if (Global.ConfirmLogin())                   // Check for Cherwell Webservices connection
            {
                _newUser = new CherwellBusinessObject(); //New instance of Cherwell Object by Reference

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);                                 // If recordId is empty then redirect to new Customer
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId); // Getting current user details
                if (IsPostBack)
                {
                    return;             // if postback then do not reset user details
                }
                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                var country = Details.GetListCherwellBusinessObjects("Country", "Status", "Active", "Record");
                ddlCountry.Items.Clear();
                ddlCountry.Items.Add("");
                foreach (var item in country)
                {
                    ddlCountry.Items.Add(item.FieldList.Fields[1].Value);
                }

                btnDelete.Visible = false;
                RetrieveMembers();
                SetMemberDetails();
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=BusinessUnits.aspx");
            }
        }
Пример #14
0
        public static CherwellBusinessObject GetEmptyCherwellBusinessObject(string busObj, string field,
                                                                            string fieldValue, string xmlElement)
        {
            var recordId = RecordId.GetRecordId(Global.CherwellConnection.QueryByFieldValue(busObj, field, fieldValue),
                                                xmlElement);
            var cherwellBusinessObject = new CherwellBusinessObject();

            foreach (var current in recordId)
            {
                cherwellBusinessObject = GetDetails(busObj, current);
                var fields = cherwellBusinessObject.FieldList.Fields;
                for (var i = 0; i < fields.Length; i++)
                {
                    var cherwellField = fields[i];
                    cherwellField.Value = "";
                }
            }
            return(cherwellBusinessObject);
        }
Пример #15
0
        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);
        }
Пример #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();

            _newUserRecordId = Request.QueryString["RECID"];

            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                var stringBuilder = new StringBuilder();
                stringBuilder.Append("Dear " + _newUser.FieldList.Fields[9].Value + ",\n");
                stringBuilder.Append("\n");
                stringBuilder.Append(
                    "You have already completed the On-line Credit Application Form and as mentioned during the application. Once completed you cannot reuse the application URL.\n");
                stringBuilder.Append("\n");
                stringBuilder.Append(
                    "Please be so kind to await the outcome of your initial application. You should be notified with the result via phone or e-mail once this application has been completed.\n");
                stringBuilder.Append(
                    "Should you have any queries regarding the outstanding application please feel free to contact BidFood Pty Ltd via phone or e-mail.\n");
                stringBuilder.Append("\n");
                stringBuilder.Append("Thank you for your patience and understanding.\n\n");
                stringBuilder.Append("BidFood Pty Ltd.");
                txtSorryText.Text = stringBuilder.ToString();
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx");
            }
        }
Пример #17
0
        protected bool CheckField()
        {
            _newUserRecordId = Request.QueryString["RECID"];
            _newUser         = Details.GetDetails("Customer - External", _newUserRecordId);

            if (int.Parse(txtCreditLimit.Text) <= 0 || IsNumber(txtCreditLimit.Text))
            {
                Response.Write(
                    "<script LANGUAGE='JavaScript' >alert('You have not set the amount of credit limit you are applying for. Please set a credit limit. Default is R20000')</script>");
            }
            if (string.IsNullOrEmpty(txtCreditLimit.Text))
            {
                Response.Write(
                    "<script LANGUAGE='JavaScript' >alert('You have not set the amount of credit limit you are applying for. Please set a credit limit. Default is R20000')</script>");
                txtCreditLimit.Text = "20000";
                return(false);
            }
            if (string.IsNullOrEmpty(ddlTerms.Text))
            {
                Response.Write("<script LANGUAGE='JavaScript' >alert('Please select the repayment terms')</script>");
                return(false);
            }
            if (string.IsNullOrEmpty(_newUser.FieldList.Fields[45].Value))
            {
                Response.Write(
                    "<script LANGUAGE='JavaScript' >alert('You have not selected a country in your business address. This way it will be impossible to determine who should evaluate your Application.')</script>");
                Response.Redirect("~/BusinessAddress.aspx?RECID=" + _newUserRecordId);
            }
            if (!string.IsNullOrEmpty(_newUser.FieldList.Fields[48].Value))
            {
                return(true);
            }
            Response.Write(
                "<script LANGUAGE='JavaScript' >alert('You have not selected a province in your business address. This way it will be impossible to determine who should evaluate your Application.')</script>");
            Response.Redirect("~/BusinessAddress.aspx?RECID=" + _newUserRecordId);
            return(true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();

            _newUserRecordId     = base.Request.QueryString["RECID"];
            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();

                if (string.IsNullOrEmpty(this._newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }
                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);
                if (IsPostBack)
                {
                    return;
                }

                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }
                var root             = Server.MapPath("~");
                var path             = Path.Combine(root, "Resources\\Guarantee.txt");
                var guaranteeAllText = File.ReadAllText(path);
                txtGuarantee.Text = guaranteeAllText;
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=Guarantee.aspx");
            }
        }
Пример #19
0
        public static CherwellBusinessObject GetDetails(string busObj, string recId)
        {
            var businessObject = Global.CherwellConnection.GetBusinessObject(busObj, recId);

            return(CherwellBusinessObject.FromXmlString(businessObject));
        }
Пример #20
0
        public static string CreateCherwellBusinessObject(string busObj, CherwellBusinessObject createObject)
        {
            var text = createObject.ToXmlString();

            return(Global.CherwellConnection.CreateBusinessObject(busObj, createObject.ToXmlString()));
        }
Пример #21
0
 public static string UpdateDetails(string busObj, string recId, CherwellBusinessObject newUser)
 {
     return(Global.CherwellConnection.UpdateBusinessObject(busObj, recId, newUser.ToXmlString()));
 }
        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);
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetNoServerCaching();
            Response.Cache.SetNoStore();

            _newUserRecordId = Request.QueryString["RECID"];

            Page.EnableViewState = true;
            if (Global.ConfirmLogin())
            {
                _newUser = new CherwellBusinessObject();


                if (string.IsNullOrEmpty(_newUserRecordId))
                {
                    Response.Redirect(Global.Redirect);
                }

                _newUser = Details.GetDetails("Customer - External", _newUserRecordId);

                var test = _newUser.ToXmlString();

                if (IsPostBack)
                {
                    return;
                }

                if (_newUser.FieldList.Fields[122].Value == "True")
                {
                    Response.Redirect("~/ApplicationCompleted.aspx?RECID=" + _newUserRecordId);
                }

                var natureOfBusiness =
                    Details.GetListCherwellBusinessObjects("Nature of Business", "Status", "Active", "Record");
                ddlNatureOfBusiness.Items.Clear();
                ddlNatureOfBusiness.Items.Add("");

                foreach (var item in natureOfBusiness)
                {
                    ddlNatureOfBusiness.Items.Add(item.FieldList.Fields[8].Value);
                }

                GetCustomerDetails();
                ChkPremisesLeased_CheckedChanged(null, null);

                if (_newUser.FieldList.Fields[117].Value != "False")
                {
                    return;
                }
                lblRegNumber.Text = "SA ID Number";
                txtReg1.Width     = 100;
                txtReg2.Visible   = false;
                txtReg2.Text      = string.Empty;
                txtReg3.Visible   = false;
                txtReg3.Text      = string.Empty;
                lblslash1.Visible = false;
                lblslash2.Visible = false;
            }
            else
            {
                Response.Redirect("~/LoadFailure.aspx?RECID=" + _newUserRecordId + "&PAGE=BusinessDetails.aspx");
            }
        }