Exemplo n.º 1
0
        public JsonResult AddedLandLord(LandlordResponse model)
        {
            CreateLandLordRequest request = new CreateLandLordRequest();
            request.LandlordID = model.LandlordID;
            request.Title = model.Title;
            request.Name = model.Name;
            request.FirstName = model.FirstName;
            request.LastName = model.LastName;
            request.SecondName = model.SecondName;
            request.ThirdName = model.ThirdName;
            request.Type = model.Type;
            request.IDNumber = model.IDNumber;
            request.AddressUnitNr = model.AddressUnitNr;
            request.ComplexName = model.ComplexName;
            request.StreetNumber = model.StreetNumber;
            request.StreetName = model.StreetName;
            request.CityName = model.CityName;
            request.PostalCode = model.PostalCode;
            request.TelWork = model.TelWork;
            request.TelMobile = model.TelMobile;
            request.Fax = model.Fax;
            request.Email = model.Email;
            request.Website = model.Website;
            request.VatNumber = model.VatNumber;
            request.RegNumber = model.RegNumber;

            var result = ApiWrapper.Post<Landlord>("api/landlord/add", request);

            return Json(result);
        }
Exemplo n.º 2
0
        public JsonResult Get(int id)
        {
            LandlordResponse response = null;

            Landlord landlord = db.LandLords.Where(x => x.LandlordID == id).FirstOrDefault();

            if (landlord != null)
            {
                response = new LandlordResponse();
                response.LandlordID = landlord.LandlordID;
                response.Title = landlord.Title;
                response.Name = landlord.Name;
                response.FirstName = landlord.FirstName;
                response.LastName = landlord.LastName;
                response.SecondName = landlord.SecondName;
                response.ThirdName = landlord.ThirdName;
                response.Type = landlord.Type;
                response.IDNumber = landlord.IDNumber;
                response.AddressUnitNr = landlord.AddressUnitNr;
                response.ComplexName = landlord.ComplexName;
                response.StreetNumber = landlord.StreetNumber;
                response.StreetName = landlord.StreetName;
                response.CityName = landlord.CityName;
                response.PostalCode = landlord.PostalCode;
                response.TelWork = landlord.TelWork;
                response.TelMobile = landlord.TelMobile;
                response.Fax = landlord.Fax;
                response.Email = landlord.Email;
                response.Website = landlord.Website;
                response.VatNumber = landlord.VatNumber;
                response.RegNumber = landlord.RegNumber;
            }

            return Json(response, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
        public ActionResult AddLandLord(int landlordID = 0)
        {
            LandlordResponse formModel = new LandlordResponse();

            if (landlordID != 0)
            {
                LandlordResponse landlord = ApiWrapper.Get<LandlordResponse>("api/landlord/" + landlordID);
                formModel.LandlordID = landlord.LandlordID;
                formModel.Title = landlord.Title;
                formModel.Name = landlord.Name;
                formModel.FirstName = landlord.FirstName;
                formModel.LastName = landlord.LastName;
                formModel.SecondName = landlord.SecondName;
                formModel.ThirdName = landlord.ThirdName;
                formModel.Type = landlord.Type;
                formModel.IDNumber = landlord.IDNumber;
                formModel.AddressUnitNr = landlord.AddressUnitNr;
                formModel.ComplexName = landlord.ComplexName;
                formModel.StreetNumber = landlord.StreetNumber;
                formModel.StreetName = landlord.StreetName;
                formModel.CityName = landlord.CityName;
                formModel.PostalCode = landlord.PostalCode;
                formModel.VatNumber = landlord.VatNumber;
                formModel.RegNumber = landlord.RegNumber;
                formModel.TelWork = landlord.TelWork;
                formModel.TelMobile = landlord.TelMobile;
                formModel.Fax = landlord.Fax;
                formModel.Email = landlord.Email;
                formModel.Website = landlord.Website;
            }


            return View("Add", formModel);
        }
Exemplo n.º 4
0
        public static Landlord Create(LandlordResponse response)
        {
            if (response == null)
                return null;

            Landlord landlord = new Landlord();
            landlord.LandlordID = response.LandlordID;
            landlord.Type = response.Type;
            landlord.Name = response.Name;
            landlord.AddressUnitNr = response.AddressUnitNr;
            landlord.ComplexName = response.ComplexName;
            landlord.StreetNumber = response.StreetNumber;
            landlord.StreetName = response.StreetName;
            landlord.Suburb = response.Suburb;
            landlord.CityName = response.CityName;
            landlord.PostalCode = response.PostalCode;
            landlord.TelWork = response.TelWork;
            landlord.TelMobile = response.TelMobile;
            landlord.Fax = response.Fax;
            landlord.Email = response.Email;
            landlord.Website = response.Website;
            landlord.Title = response.Title;
            landlord.FirstName = response.FirstName;
            landlord.SecondName = response.SecondName;
            landlord.ThirdName = response.ThirdName;
            landlord.LastName = response.LastName;
            landlord.IDNumber = response.IDNumber;
            landlord.RegNumber = response.RegNumber;
            landlord.VatNumber = response.VatNumber;
            return landlord;

        }