예제 #1
0
 public SGMLactor(Uri url, int type)
 {
     this._uri = url;
     _flat = new flat();
     string adv_number = url.Segments[url.Segments.Length-1];
     _flat.uid = int.Parse(adv_number.Split('.')[0]);
     _type = (RealtyType)type;
 }
예제 #2
0
        public ActionResult AddEstateObject(int realtyType)
        {
            EstateObjectViewModel model = _estateObjectService.Model();
            Agency     db     = new Agency();
            RealtyType result = db.RealtyTypes.FirstOrDefault(f => f.Id == realtyType);

            model.RealtyTypeId = realtyType;
            model.RealtyType   = result.Name;
            return(View(model));
        }
예제 #3
0
        public async Task <ActionResult> AddEstateObject(EstateObjectViewModel model)
        {
            if (!ModelState.IsValid)
            {
                Agency     db     = new Agency();
                RealtyType result = db.RealtyTypes.FirstOrDefault(f => f.Id == model.RealtyTypeId);
                model = _estateObjectService.Model();
                model.RealtyTypeId = result.Id;
                model.RealtyType   = result.Name;
                return(View(model));
            }

            EstateObject eo = await _estateObjectService.EstateObject(model);

            eo.StatusId = 1;
            await _estateObjectService.AddEstateObject(eo);

            return(RedirectToAction("Index"));
        }