public bool Add(clsClient obj, int ID) { if (Exist(ID)) { return(false); } else { myList.Add(ID, obj); return(true); } }
public bool Update(clsClient obj, int ID) { if (!Exist(ID)) { return(false); } else { if (Delete(ID)) { myList.Add(ID, obj); return(true); } else { return(false); } } }
public static clsListClients getClientsNeedConnectToHouse() { clsListClients tmp = new clsListClients(); IRemaxData rmx = new clsRemaxData(); DataTable tab = null; tab = rmx.getClientsNeedConnectToHouse(); foreach (DataRow rowClient in tab.Rows) { clsClient cl = new clsClient(Convert.ToInt32(rowClient["ID"].ToString()), rowClient["fullname"].ToString(), rowClient["phone"].ToString(), rowClient["email"].ToString(), (enumClientType)Enum.Parse(typeof(enumClientType), rowClient["type"].ToString())); tmp.Add(cl, cl.ID); cl = null; } tab = null; return(tmp); }
public clsHouse(int vID, string vCode, float vAria, byte vRooms, byte vBathrooms, enumCityzone vCityZone, string vAddress, float vPrice, string vDescription, enumHouseType vType, string vPic, enumHouseStatus vStatus, DateTime vDatein = new DateTime(), clsClient vClient = null, int?employeeID = null) { this.ID = vID; this.Code = vCode; this.Aria = vAria; this.Rooms = vRooms; this.Bathrooms = vBathrooms; this.CityZone = vCityZone; this.Address = vAddress; this.Price = vPrice; this.Description = vDescription; this.Type = vType; this.Pic = vPic; this.Status = vStatus; this.Datein = vDatein; this.Client = vClient; this.EmployeeID = employeeID; }
public static clsListHouses getHouses() { clsListHouses tmp = new clsListHouses(); IRemaxData rmx = new clsRemaxData(); DataTable tab = null; tab = rmx.getHouses(); foreach (DataRow rowHouse in tab.Rows) { //Get client for house clsClient client = null; if (Convert.ToInt32(rowHouse["client"].ToString()) > 0) { DataRow rowClient = rmx.getClient(Convert.ToInt32(rowHouse["client"].ToString())); if (rowClient != null) { client = new clsClient(Convert.ToInt32(rowClient["ID"].ToString()), rowClient["fullname"].ToString(), rowClient["phone"].ToString(), rowClient["email"].ToString(), (enumClientType)Enum.Parse(typeof(enumClientType), rowClient["type"].ToString()), null); } } clsHouse house = new clsHouse(Convert.ToInt32(rowHouse["id"].ToString()), rowHouse["code"].ToString(), Convert.ToSingle(rowHouse["aria"].ToString()), Convert.ToByte(rowHouse["rooms"].ToString()), Convert.ToByte(rowHouse["bathrooms"].ToString()), (enumCityzone)Enum.Parse(typeof(enumCityzone), rowHouse["cityzone"].ToString()), rowHouse["address"].ToString(), Convert.ToSingle(rowHouse["price"].ToString()), rowHouse["description"].ToString(), (enumHouseType)Enum.Parse(typeof(enumHouseType), rowHouse["type"].ToString()), rowHouse["pic"].ToString(), (enumHouseStatus)Enum.Parse(typeof(enumHouseStatus), rowHouse["status"].ToString()), Convert.ToDateTime(rowHouse["datein"]), client, Convert.ToInt32(rowHouse["employee"].ToString())); tmp.Add(house, house.Code); house = null; } tab = null; return(tmp); }