public static bool UpdatePropertyOwner(PropertyOwnerDTO po) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { PropertiesOwner pro = db.PropertiesOwners.Find(po.OwnerID); pro.OwnerID = p.OwnerID; pro.CityID = p.CityID; this.CityName = p.CityName; this.StreetID = p.StreetID; this.StreetName = p.StreetName; this.Number = p.Number; this.Size = p.Size; this.Floor = p.Floor; this.IsDivided = p.IsDivided; this.ManagmentPayment = p.ManagmentPayment; this.IsPaid = p.IsPaid; this.IsExclusivity = p.IsExclusivity; this.ExclusivityID = p.ExclusivityID; this.IsWarranty = p.IsWarranty; this.IsRented = p.IsRented; this.RoomsNum = p.RoomsNum; this.ApartmentNum = p.ApartmentNum; db.SaveChanges(); return(true); } return(false); }
public IHttpActionResult UpdatePropertyOwner([FromBody] PropertyOwnerDTO po) { bool b = Bl.PropertyOwnerBL.UpdatePropertyOwner(po); if (b) { return(Ok()); } return(BadRequest()); }
public IHttpActionResult AddPropertyOwner(PropertyOwnerDTO po) { bool b = Bl.PropertyOwnerBL.AddPropertyOwner(po); if (b) { return(Ok()); } return(BadRequest()); }
public static bool UpdatePropertyOwner(PropertyOwnerDTO po) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { Property pro = db.Properties.Find(po.OwnerID); pro.OwnerFirstName = po.OwnerFirstName; pro.OwnerLastName = po.OwnerLastName; pro.Phone = po.Phone; pro.Email = po.Email; db.SaveChanges(); return(true); } return(false); }
public static bool AddPropertyOwner(PropertyOwnerDTO pod) { PropertiesOwner poDal = PropertyOwnerDTO.ToDal(pod); int id = PropertyOwnerDAL.AddPropertyOwner(poDal); if (id != 0) { if (pod.Dock != null) { Document doc = new Document(); doc.DocCoding = pod.Dock; doc.DocUser = id; doc.type = 2; doc.DocName = pod.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } return(true); } return(false); }
public static bool UpdatePropertyOwner(PropertyOwnerDTO po) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { PropertiesOwner pro = db.PropertiesOwners.Find(po.OwnerID); pro.OwnerFirstName = po.OwnerFirstName; pro.OwnerLastName = po.OwnerLastName; pro.Phone = po.Phone; pro.Email = po.Email; if (po.Dock != null) { Document doc = new Document(); doc.DocCoding = po.Dock; doc.DocUser = po.OwnerID; doc.type = 2; doc.DocName = po.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } db.SaveChanges(); return(true); } return(false); }
public IHttpActionResult Search([FromBody] PropertyOwnerDTO pd) { return(Ok(Bl.PropertyOwnerBL.Search(pd.OwnerFirstName, pd.OwnerLastName, pd.Phone, pd.Email))); }
public static bool AddPropertyOwner(PropertyOwnerDTO po) { PropertiesOwner poDal = PropertyOwnerDTO.ToDal(po); return(PropertyOwnerDAL.AddPropertyOwner(poDal)); }
public static bool DeletPropertyOwner(PropertyOwnerDTO po) { PropertiesOwner poDal = PropertyOwnerDTO.ToDal(po); return(PropertyOwnerDAL.DeletePropertyOwner(poDal)); }