コード例 #1
0
ファイル: clsClient.cs プロジェクト: imovila/Remax
 public clsClient(int ID, string fullname, string phone, string email, enumClientType type, clsListHouses houses = null)
 {
     this.ID       = ID;
     this.Fullname = fullname;
     this.Phone    = phone;
     this.Email    = email;
     this.Type     = type;
     this.Houses   = houses;
 }
コード例 #2
0
 public clsEmployee(int ID, string Code, string Fullname, enumGender Gender, enumCityzone Cityzone,
                    string Username, string Password, enumEmployeeType Employeetype, enumLang Lang,
                    string Pic, clsListHouses Houses = null)
 {
     this.ID           = ID;
     this.Fullname     = Fullname;
     this.Gender       = Gender;
     this.Cityzone     = Cityzone;
     this.Code         = Code;
     this.Username     = Username;
     this.Password     = Password;
     this.Employeetype = Employeetype;
     this.Lang         = Lang;
     this.Pic          = Pic;
     this.Houses       = new clsListHouses();
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        public static clsListHouses getHousesForSales(int?agentID = null)
        {
            clsListHouses tmp = new clsListHouses();

            IRemaxData rmx = new clsRemaxData();
            DataTable  tab = null;

            tab = rmx.getHousesForSales(agentID);

            foreach (DataRow rowHouse in tab.Rows)
            {
                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"]));

                tmp.Add(house, house.Code);
                house = null;
            }
            tab = null;
            return(tmp);
        }