public static bool UpdateSubProperty(SubPropertyDTO spd) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { SubProperty sp = db.SubProperties.Find(spd.SubPropertyID); sp.num = spd.num; sp.IsRented = spd.IsRented; sp.Size = spd.Size; sp.RoomsNum = spd.RoomsNum; if (spd.Dock != null) { Document doc = new Document(); doc.DocCoding = spd.Dock; doc.DocUser = spd.SubPropertyID; doc.type = 5; doc.DocName = spd.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } db.SaveChanges(); return(true); } return(false); }
public static bool AddRenewTask(int propertyID, int?subpropertyID) { TaskDTO t = new TaskDTO(); t.TaskTypeId = 2; if (subpropertyID != null) { SubPropertyDTO sub = Bl.SubPropertyBL.GetSubPropertyByID(subpropertyID.Value); t.Description = propertyID + "בנכס " + sub.num + "סיום חוזה לדירה מס:"; } else { t.Description = propertyID + "סיום חוזה לדירה:"; } t.PropertyID = propertyID; t.SubPropertyID = subpropertyID; t.ClassificationID = 3; t.ClientClassificationID = null; //////// t.ReportDate = DateTime.Today; t.DateForHandling = DateTime.Today.AddMonths(3); //לבדוק למה כתבה 1 t.IsHandled = false; t.HandlingDate = null; t.status = true; return(AddTask(t)); }
public IHttpActionResult UpdateSubProperty([FromBody] SubPropertyDTO spd) { if (Bl.SubPropertyBL.UpdateSubProperty(spd)) { return(Ok()); } return(BadRequest()); }
public IHttpActionResult AddSubProperties([FromBody] SubPropertyDTO spd) { bool b = Bl.SubPropertyBL.AddSubProperty(spd); if (b == true) { return(Ok()); } return(BadRequest()); }
public static bool AddSubProperty(SubPropertyDTO spd) { SubProperty sp = SubPropertyDTO.ToDal(spd); int id = SubPropertyDAL.AddSubProperty(sp); if (id != 0) { if (spd.Dock != null) { Document doc = new Document(); doc.DocCoding = spd.Dock; doc.DocUser = id; doc.type = 5; doc.DocName = spd.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } return(true); } return(false); }
public IHttpActionResult Search(SubPropertyDTO sd) { return(Ok(Bl.SubPropertyBL.Search(sd))); }
public static List <SubPropertyDTO> Search(SubPropertyDTO sd) { List <SubProperty> subProperties = SubPropertyDAL.Search(sd.PropertyID, sd.num, sd.Size, sd.RoomsNum); return(ConvertListToDTO(subProperties)); }