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 PropertyOwnerDTO(PropertiesOwner po) { OwnerID = po.OwnerID; OwnerFirstName = po.OwnerFirstName; OwnerLastName = po.OwnerLastName; Phone = po.Phone; Email = po.Email; }
public static bool DeletePropertyOwner(int id) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { PropertiesOwner p = db.PropertiesOwners.Find(id); p.status = false; 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 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)); }