示例#1
0
        public void Submit_Without_User_Application()
        {
            SolaApplicationService appSvc = new SolaApplicationService();

            appSvc.SubmitToSola();
            Assert.AreEqual(appSvc.app.Status, "No User");
            Assert.IsNull(appSvc.app.SolaId);
            Assert.IsFalse(appSvc.isComplete());
        }
示例#2
0
        public void Save_Without_Contact_Person()
        {
            SolaApplicationService appSvc = new SolaApplicationService();

            appSvc.app.UserId = "1324";
            appSvc.save();
            Assert.AreEqual(appSvc.app.Status, "Incomplete");
            Assert.IsFalse(appSvc.isComplete());
        }
示例#3
0
        public void Test_Save_Application()
        {
            SolaApplicationService SolaAppSvc = new SolaApplicationService();
            Application            app        = SolaAppSvc.app;

            app.UserId              = "e911miri";
            app.ContactPerson.DOB   = DateTime.Today;
            app.ContactPerson.Email = "*****@*****.**";

            app.Properties.Add(new Property()
            {
                Developed = false,
                LandUse   = "Cultivating of Home grown Cashew Trees"
            });

            //Application is still detached in this case
            Assert.AreEqual(app.EntityState, EntityState.Detached);
            SolaAppSvc.save();

            //Application should have an entity key
            Assert.IsNotNull(app.EntityKey);

            //Application should have an unchanged state after save
            Assert.AreEqual(app.EntityState, EntityState.Unchanged);

            //Application should exist in the database
            Assert.IsNotNull(SolaAppSvc.getApplicationById(app.Id));

            //Application Id should not be changed during the save process
            Assert.AreEqual(app.Id, SolaAppSvc.getApplicationById(app.Id).Id);

            //The Application should have a contact person
            Assert.IsNotNull(app.ContactPerson);

            //There should be only one party and one property attached to this application
            Assert.IsTrue(app.Parties.Count == 1);
            Assert.IsTrue(app.Properties.Count == 1);

            Assert.IsFalse(SolaAppSvc.isComplete());
        }
示例#4
0
        public void SubmitApplicationToSola()
        {
            Application app = new Application();

            app.StartDate                = DateTime.Now;
            app.UserId                   = "e911miri";
            app.ContactPerson.Email      = "*****@*****.**";
            app.ContactPerson.DOB        = DateTime.Today;
            app.ContactPerson.Firstname  = "Tomiwa";
            app.ContactPerson.Surname    = "Ijaware";
            app.ContactPerson.Middlename = "Wisdom";
            app.ContactPerson.MobileNo   = "07037290250";
            app.ContactPerson.Addresses.Add(new Address()
            {
                City   = "akure",
                State  = "Ondo",
                Street = "No 1. Mt Gerizm Road",
                PMBNo  = "10"
            });

            //app.Properties.Add(new Property()
            //{
            //    Developed = false,
            //    LandUse = "Smoking"
            //});
            //app.SubmissionDate = DateTime.Now;

            SolaApplicationService SolaAppSvc = new SolaApplicationService();

            SolaAppSvc.app = app;
            SolaAppSvc.save();
            Assert.IsNotNull(SolaAppSvc.getApplicationById(app.Id));
            Assert.AreEqual(app.Id, SolaAppSvc.getApplicationById(app.Id).Id);

            var appTO = SolaAppSvc.SubmitToSola();

            Assert.IsNotNull(appTO);
        }
示例#5
0
    protected void Application_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (this.ContactInfoControl.save() == true && this.ApplicantInfoControl.save() == true && this.PropertyInfoControl.save() == true)
        {
            var     appService = new SolaApplicationService();
            Address add        = new Address
            {
                City   = ContactInfoControl.City,
                State  = ContactInfoControl.State,
                PMBNo  = ContactInfoControl.PoBox,
                Street = ContactInfoControl.StreetName
            };

            Document doc = new Document();
            doc.Description  = Session["desc"].ToString();
            doc.DocumentType = Session["type"].ToString();
            doc.FileName     = Session["name"].ToString();
            doc.Extension    = Session["type"].ToString();
            string file = Session["path"].ToString();
            doc.Content = File.ReadAllBytes(file);

            Property prop     = new Property();
            Address  propAddr = new Address();
            propAddr.PMBNo  = "nothing";
            propAddr.Street = this.PropertyInfoControl.PropertyLocation;
            propAddr.State  = "Ondo state";
            propAddr.City   = this.PropertyInfoControl.PropertyLocation;
            prop.Addresses.Add(propAddr);
            prop.CapacityofOwnership = this.PropertyInfoControl.CapacityOfOwnership;
            prop.Developed           = this.PropertyInfoControl.Developed;
            prop.LandUse             = this.PropertyInfoControl.LandUse;
            prop.PeriodofPossession  = this.PropertyInfoControl.LengthOfOwnership;
            prop.ApproximateArea     = Convert.ToDecimal(this.PropertyInfoControl.ApproximateArea);
            //prop.Developed=this.PropertyInfoControl.

            appService.app.ContactPerson.Addresses.Add(add);
            appService.app.UserId                        = "samuelNet";
            appService.app.ContactPerson.DOB             = this.ApplicantInfoControl.DateOfBirth;
            appService.app.ContactPerson.Email           = this.ContactInfoControl.Email;
            appService.app.ContactPerson.EmployerAddress = this.ApplicantInfoControl.EmployerAddress;
            appService.app.ContactPerson.EmployerName    = this.ApplicantInfoControl.EmployerName;
            appService.app.ContactPerson.Fax             = this.ContactInfoControl.Fax;
            appService.app.ContactPerson.Firstname       = this.ApplicantInfoControl.FirstName;
            appService.app.ContactPerson.Gender          = this.ApplicantInfoControl.Sex;
            appService.app.ContactPerson.HomeNo          = this.ContactInfoControl.Phone2;
            appService.app.ContactPerson.HomeTown        = this.ApplicantInfoControl.LGA;
            appService.app.ContactPerson.LGA             = this.ApplicantInfoControl.LGA;
            appService.app.ContactPerson.Middlename      = this.ApplicantInfoControl.Othernames;
            appService.app.ContactPerson.MobileNo        = this.ContactInfoControl.Phone;
            appService.app.ContactPerson.Occupation      = this.ApplicantInfoControl.Occupation;
            appService.app.ContactPerson.OfficeNo        = this.ContactInfoControl.Phone2;
            appService.app.ContactPerson.StateofOrigin   = this.ApplicantInfoControl.StateOfOrigin;
            appService.app.ContactPerson.Surname         = this.ApplicantInfoControl.SurName;
            appService.app.OtherRelevantInfo             = this.PropertyInfoControl.RelevantInfo;
            appService.app.Documents.Add(doc);
            appService.app.Properties.Add(prop);
            appService.app.StartDate            = DateTime.Now;
            appService.app.SubmittedbyApplicant = true;
            appService.save();
            File.Delete(file);
            Response.Redirect("Success.aspx");
        }
        else
        {
            //Load Party information
            //Load property information
            Response.Redirect("~/User/Certificates.aspx");
        }
    }