예제 #1
0
파일: editform.cs 프로젝트: rieltor/realt
        public editform()
        {
            InitializeComponent();
            dbvals = new Photos("");
            dbw = new DBWrap();
            record = new estaterecord();
            dbw.LoadAddressBase();
            dbcomm = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            foreach (string value in dbw.balconyValues)
                balcony.Properties.Items.Add(value, CheckState.Unchecked, true);
            foreach (string value in dbw.loggiaValues)
                loggia.Properties.Items.Add(value, CheckState.Unchecked, true);

            comboBox5.Items.AddRange(dbw.housetypeValues);
            comboBox5.SelectedIndex = 12;
            comboBox6.Items.AddRange(dbw.wallValues);
            comboBox6.SelectedIndex = 1;
            comboBox7.Items.AddRange(dbw.roomlayoutValues);
            comboBox7.SelectedIndex = 4;
            comboBox14.Items.AddRange(dbw.phoneValues);
            comboBox14.SelectedIndex = 0;
               // comboBox15.Items.AddRange(roomlayoutValues);
               //  comboBox15.SelectedIndex = 4;
            comboBox12.Items.AddRange(dbw.conditionValues);
            comboBox12.SelectedIndex = 1;
            comboBox8.Items.AddRange(dbw.maindoorValues);
            comboBox8.SelectedIndex = 1;
            comboBox13.Items.AddRange(dbw.propertyValues);
            comboBox13.SelectedIndex = 7;
            comboBox9.Items.AddRange(dbw.windowValues);
            comboBox9.SelectedIndex = 4;
            comboBox10.Items.AddRange(dbw.doorValues);
            comboBox10.SelectedIndex = 0;
            comboBox11.Items.AddRange(dbw.sewerageValues);
            comboBox11.SelectedIndex = 0;
            comboBox16.Items.AddRange(dbw.tubeValues);
            comboBox16.SelectedIndex = 2;
            comboBox19.Items.AddRange(dbw.estateValues);
            comboBox19.SelectedIndex = 0;
            comboBox17.Items.AddRange(dbw.operationValues);
            comboBox17.SelectedIndex = 0;
            comboBox18.Items.AddRange(dbw.stateValues);
            comboBox18.SelectedIndex = 0;

            textBox9.Text = "1";
            textBox8.Text = "1";
            textBox10.Text = "1";
            textBox11.Text = "1";

            textBox12.Text = "0";
            textBox13.Text = "0";
            textBox14.Text = "0";
            textBox15.Text = "0";
            textBox16.Text = "2.5";

            // Specify the separator character.
            balcony.Properties.SeparatorChar = ',';
            loggia.Properties.SeparatorChar = ',';
            listBox2.Items.Clear();
            for (int i = 0; i < dbvals.photolist.Count;i++)
            { listBox2.Items.Add(dbvals.photolist[i]); }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0) { listBox2.SelectedIndex = 1; }
            if (dbvals.photolist.Count>0) pictureEdit1.Image = (dbvals.photolist[0] as Img).Picture;
            comboBox2.DataSource = dbw.district;
            comboBox2.DisplayMember = dbw.district.Columns[1].ColumnName;
            comboBox3.DataSource = dbw.town;
            comboBox3.DisplayMember = dbw.town.Columns[1].ColumnName;
            comboBox4.DataSource = dbw.street;
            comboBox4.DisplayMember = dbw.street.Columns[0].ColumnName;
            comboBox2.SelectedIndex = 0;
            comboBox3.SelectedIndex = 2;
            comboBox4.SelectedIndex = 0;
            comboBox2.BindingContext = this.BindingContext;
            comboBox3.BindingContext = this.BindingContext;
            comboBox4.BindingContext = this.BindingContext;
        }
예제 #2
0
파일: editform.cs 프로젝트: rieltor/realt
        //int operation;
        public editform(string id, bool rent, bool isadmin)
        {
            InitializeComponent();
            dbvals = new Photos("http://tamarrra.net/img1/esterne201755292010175841_big.jpg;http://tamarrra.net/img1/esterne201755302010175843_big.jpg;http://tamarrra.net/img1/esterne201755312010175845_big.jpg");
            dbw = new DBWrap();
            estaterecord record = dbw.ReadEstate(id);
            dbw.LoadAddressBase();
            dbcomm = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            rieltorname.Text = record.Ragent_code;
            buildingtype.Text = record.Rhouse_type;
            material.Text = record.Rwalling_type;
            planning.Text = record.Rroom_layout;
            phone.Text = record.Rtelephone;
            condition.Text = record.Rcondition2;
            maindoor.Text = record.Rfront_door_type;
            ownertype.Text = record.Rproperty_type;
            windows.Text = record.Rwindow_material;
            doors.Text = record.Rinterior_door_type;
            canalization.Text = record.Rsewerage;
            tubes.Text = record.Rtubing_material;
            code.Text = record.Restate_type;
            label89.Text = record.Roperation;
            label91.Text = record.Rstatus;

            dateTimePicker3.Value = record.Rdate_add;
            dateTimePicker4.Value = record.Rdate_change;
            dateTimePicker6.Value = record.Rtrade_date;

            dateTimePicker3.Enabled = false;
            dateTimePicker4.Enabled = false;
            dateTimePicker6.Enabled = false;

            floor.Text += record.Rfloor.ToString();
            rooms.Text = record.Rroom_quantity.ToString();
            totalfloor.Text += record.Rnumber_of_storeys.ToString();
            label70.Text = record.Rlevel_quantity.ToString();

            totalarea.Text = record.Rtotal_floor_space.ToString() + " м2";
            livingarea.Text = record.Rfloor_space.ToString() + " м2";
            hallarea.Text = record.Rhall_floor_space + " м2";
            kitchenarea.Text = record.Rkitchen_floor_space + " м2";
            high.Text = record.Rceiling_height + " м";

            district.Text = record.Rdistrict_region + " ," + record.Rcity;
            if (record.Rblock_no == "")
            { street.Text = record.Rstreet + " ," + func.Decrypt(record.Rhouse_no, func.fkey); }
            else { street.Text = record.Rstreet + " ," + func.Decrypt(record.Rhouse_no, func.fkey) + "/" + func.Decrypt(record.Rblock_no, func.fkey); }
            orient.Text = func.Decrypt(record.Rflat_no, func.fkey);

            if (record.Rhaggle == 1) { checkBox47.Checked = true; }
            if (record.Ruse_for_office == 1) { checkBox48.Checked = true; }
            if (record.Rparking == 1) { checkBox45.Checked = true; }
            if (record.Routhouse_legality == 1) { checkBox46.Checked = true; }
            if (record.RFridge == 1) { checkBox26.Checked = true; }

            if (rent)
            {
                checkBox46.Visible = false;
                checkBox26.Visible = true;
                checkBox46.Enabled = false;
                checkBox26.Enabled = true;
                checkBox26.Left = 530;
                checkBox26.Top = 51;
            }
            else
            {
                checkBox46.Visible = true;
                checkBox26.Visible = false;
                checkBox46.Enabled = true;
                checkBox26.Enabled = false;
                checkBox46.Left = 530;
                checkBox46.Top = 51;
            }

            bath.Text = record.Rbathroom_note;
            kitchen.Text = record.Rkitchen_note;
            backroom.Text = record.Rbackrooms;
            stuff.Text = record.Rnote;

            description.Text = record.Rdescription_detail;

            gas.Text = record.Rgas_supply;
            warm.Text = record.Rheat_supply;
            water.Text = record.Rwater_supply;
            balcon.Text = record.Rbalcony;
            logja.Text = record.Rloggia;
            lootype.Text = record.Rbathroom;

            price.Text = record.Rprice.ToString();
            if (rent)
            {
                dayprice.Text = record.Rrent_price_day.ToString();
                monthprice.Text = record.Rrent_price_month.ToString();
            }
            else
            {
                dayprice.Visible = false;
                monthprice.Visible = false;
                label76.Visible = false;
                label77.Visible = false;
            }
            label81.Text = record.Rtrade_price.ToString();
            //item.Ragent_code = result.Rows[0][48].ToString();

            listBox2.Items.Clear();
            listView1.Items.Clear();

            for (int i = 0; i < dbvals.photolist.Count; i++)
            { listBox2.Items.Add(dbvals.photolist[i]); }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0) { listBox2.SelectedIndex = 1; }
            pictureEdit1.Image = (dbvals.photolist[1] as Img).Picture;

            simpleButton3.Visible = false;
            simpleButton4.Visible = false;
            simpleButton8.Visible = false;
            checkBox25.Visible = false;
            textBox21.Enabled = false;

            addphotos.Visible = false;
            simpleButton7.Visible = false;
        }
예제 #3
0
파일: editform.cs 프로젝트: rieltor/realt
        public editform(string id, bool rent)
        {
            InitializeComponent();
            dbvals = new Photos("http://tamarrra.net/img1/esterne201755292010175841_big.jpg;http://tamarrra.net/img1/esterne201755302010175843_big.jpg;http://tamarrra.net/img1/esterne201755312010175845_big.jpg");
            dbw = new DBWrap();
            estaterecord record = dbw.ReadEstate(id);
            dbw.LoadAddressBase();
            dbcomm = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            foreach (string value in dbw.balconyValues)
                balcony.Properties.Items.Add(value, CheckState.Unchecked, true);
            foreach (string value in dbw.loggiaValues)
                loggia.Properties.Items.Add(value, CheckState.Unchecked, true);

            // Specify the separator character.
            balcony.Properties.SeparatorChar = ',';
            loggia.Properties.SeparatorChar = ',';

            comboBox5.Items.AddRange(dbw.housetypeValues);
            for (int i = 0; i < dbw.housetypeValues.Length;i++ )
                if (record.Rhouse_type == dbw.housetypeValues[i]) { comboBox5.SelectedIndex = i; i = dbw.housetypeValues.Length; }

            comboBox6.Items.AddRange(dbw.wallValues);
            for (int i = 0; i < dbw.wallValues.Length; i++)
                if (record.Rwalling_type == dbw.wallValues[i]) { comboBox6.SelectedIndex = i; i = dbw.wallValues.Length; }

            comboBox7.Items.AddRange(dbw.roomlayoutValues);
            for (int i = 0; i < dbw.roomlayoutValues.Length; i++)
                if (record.Rroom_layout == dbw.roomlayoutValues[i]) { comboBox7.SelectedIndex = i; i = dbw.roomlayoutValues.Length; }

            comboBox14.Items.AddRange(dbw.phoneValues);
            for (int i = 0; i < dbw.phoneValues.Length; i++)
                if (record.Rtelephone == dbw.phoneValues[i]) { comboBox14.SelectedIndex = i; i = dbw.phoneValues.Length; }

            comboBox12.Items.AddRange(dbw.conditionValues);
            for (int i = 0; i < dbw.conditionValues.Length; i++)
                if (record.Rcondition2 == dbw.conditionValues[i]) { comboBox12.SelectedIndex = i; i = dbw.conditionValues.Length; }

            comboBox8.Items.AddRange(dbw.maindoorValues);
            for (int i = 0; i < dbw.maindoorValues.Length; i++)
                if (record.Rfront_door_type == dbw.maindoorValues[i]) { comboBox8.SelectedIndex = i; i = dbw.maindoorValues.Length; }

            comboBox13.Items.AddRange(dbw.propertyValues);
            for (int i = 0; i < dbw.propertyValues.Length; i++)
                if (record.Rproperty_type == dbw.propertyValues[i]) { comboBox13.SelectedIndex = i; i = dbw.propertyValues.Length; }

            comboBox9.Items.AddRange(dbw.windowValues);
            for (int i = 0; i < dbw.windowValues.Length; i++)
                if (record.Rwindow_material == dbw.windowValues[i]) { comboBox9.SelectedIndex = i; i = dbw.windowValues.Length; }

            comboBox10.Items.AddRange(dbw.doorValues);
            for (int i = 0; i < dbw.doorValues.Length; i++)
                if (record.Rinterior_door_type == dbw.doorValues[i]) { comboBox10.SelectedIndex = i; i = dbw.doorValues.Length; }

            comboBox11.Items.AddRange(dbw.sewerageValues);
            for (int i = 0; i < dbw.sewerageValues.Length; i++)
                if (record.Rsewerage == dbw.sewerageValues[i]) { comboBox11.SelectedIndex = i; i = dbw.sewerageValues.Length; }

            comboBox16.Items.AddRange(dbw.tubeValues);
            for (int i = 0; i < dbw.tubeValues.Length; i++)
                if (record.Rtubing_material == dbw.tubeValues[i]) { comboBox16.SelectedIndex = i; i = dbw.tubeValues.Length; }

            comboBox19.Items.AddRange(dbw.estateValues);
            for (int i = 0; i < dbw.estateValues.Length; i++)
                if (record.Restate_type == dbw.estateValues[i]) { comboBox19.SelectedIndex = i; i = dbw.estateValues.Length; }

            comboBox17.Items.AddRange(dbw.operationValues);
            for (int i = 0; i < dbw.operationValues.Length; i++)
                if (record.Roperation == dbw.operationValues[i]) { comboBox17.SelectedIndex = i; i = dbw.operationValues.Length; }

            comboBox18.Items.AddRange(dbw.stateValues);
            for (int i = 0; i < dbw.stateValues.Length; i++)
                if (record.Rstatus == dbw.stateValues[i]) { comboBox18.SelectedIndex = i; i = dbw.stateValues.Length; }

            dateTimePicker2.Value = record.Rdate_add;
            dateTimePicker1.Value = record.Rdate_change;
            dateTimePicker5.Value = record.Rtrade_date;

            textBox9.Text = record.Rfloor.ToString();
            textBox8.Text = record.Rroom_quantity.ToString();
            textBox10.Text = record.Rnumber_of_storeys.ToString();
            textBox11.Text = record.Rlevel_quantity.ToString();

            textBox12.Text = record.Rtotal_floor_space.ToString();
            textBox13.Text = record.Rfloor_space.ToString();
            textBox14.Text = record.Rhall_floor_space;
            textBox15.Text = record.Rkitchen_floor_space;
            textBox16.Text = record.Rceiling_height;

            comboBox2.DataSource = dbw.district;
            comboBox2.DisplayMember = dbw.district.Columns[1].ColumnName;
            comboBox3.DataSource = dbw.town;
            comboBox3.DisplayMember = dbw.town.Columns[1].ColumnName;
            comboBox4.DataSource = dbw.street;
            comboBox4.DisplayMember = dbw.street.Columns[0].ColumnName;
            comboBox2.SelectedIndex = 0;
            comboBox3.SelectedIndex = 2;
            comboBox4.SelectedIndex = 0;
            comboBox2.BindingContext = this.BindingContext;
            comboBox3.BindingContext = this.BindingContext;
            comboBox4.BindingContext = this.BindingContext;

            for (int i = 0; i < dbw.district.Rows.Count; i++ )
                if (dbw.district.Rows[i][0].ToString() == record.Rdistrict_region) { comboBox2.SelectedIndex = i; i = dbw.district.Rows.Count; }

            for (int i = 0; i < dbw.town.Rows.Count; i++)
                if (dbw.town.Rows[i][0].ToString() == record.Rcity) { comboBox3.SelectedIndex = i; i = dbw.town.Rows.Count; }

            int street_count = dbw.street.Rows.Count;
            for (int i = 0; i < street_count; i++)
                if (dbw.street.Rows[i][1].ToString() == record.Rstreet) { comboBox4.SelectedIndex = i; i = dbw.street.Rows.Count; }

            if (record.Rblock_no != "") { textBox3.Text = String.Concat(func.Decrypt(record.Rhouse_no, func.fkey), "/", func.Decrypt(record.Rblock_no, func.fkey)); } else { textBox3.Text = func.Decrypt(record.Rhouse_no, func.fkey); }
            textBox4.Text = func.Decrypt(record.Rflat_no, func.fkey);

            if (record.Rhaggle == 1) {checkBox2.Checked = true;}
            if (record.Ruse_for_office == 1) {checkBox1.Checked = true;}
            if (record.Rparking == 1) {checkBox4.Checked = true;}
            if (record.Routhouse_legality == 1) {checkBox3.Checked = true;}
            if (record.RFridge == 1) {freezer.Checked = true; }

            textBox20.Text = record.Rbathroom_note;
            textBox19.Text = record.Rkitchen_note;
            textBox18.Text = record.Rbackrooms;
            textBox22.Text = record.Rnote;
            textBox17.Text = record.Rdescription_detail;

            if (record.Rbalcony.IndexOf("Застеклен") > -1) {balcony.Properties.Items[0].CheckState = CheckState.Checked;}
            if (record.Rbalcony.IndexOf("Не застеклен")>-1) {balcony.Properties.Items[1].CheckState = CheckState.Checked;}
            if (record.Rbalcony.IndexOf("Зарешечен") > -1) {balcony.Properties.Items[2].CheckState = CheckState.Checked; }

            if (record.Rloggia.IndexOf("Застеклена") > -1) { loggia.Properties.Items[0].CheckState = CheckState.Checked; }
            if (record.Rloggia.IndexOf("Не застеклена") > -1) { loggia.Properties.Items[1].CheckState = CheckState.Checked; }
            if (record.Rloggia.IndexOf("Зарешечена") > -1) { loggia.Properties.Items[2].CheckState = CheckState.Checked; }

            if (record.Rgas_supply.IndexOf("природный") > -1) { checkBox5.Checked = true; }
            if (record.Rgas_supply.IndexOf("баллонный") > -1) { checkBox6.Checked = true; }
            if (record.Rgas_supply.IndexOf("электроплита") > -1) { checkBox7.Checked = true; }
            if (record.Rgas_supply.IndexOf("нет") > -1) { checkBox8.Checked = true; }

            if (record.Rheat_supply.IndexOf("электрическое") > -1) { checkBox17.Checked = true; }
            if (record.Rheat_supply.IndexOf("автономное") > -1) { checkBox18.Checked = true; }
            if (record.Rheat_supply.IndexOf("нет") > -1) { checkBox19.Checked = true; }
            if (record.Rheat_supply.IndexOf("ТЭЦ") > -1) { checkBox20.Checked = true; }

            if (record.Rbathroom.IndexOf("электрическое") > -1) { checkBox17.Checked = true; }
            if (record.Rbathroom.IndexOf("автономное") > -1) { checkBox18.Checked = true; }
            if (record.Rbathroom.IndexOf("Отсутствует") > -1) { checkBox21.Checked = true; }
            if (record.Rbathroom.IndexOf("Только") > -1) { checkBox22.Checked = true; }
            if (record.Rbathroom.IndexOf("Совмещенный") > -1) { checkBox16.Checked = true; }
            if (record.Rbathroom.IndexOf("Раздельный") > -1) { checkBox15.Checked = true; }

            if (record.Rwater_supply.IndexOf("(водопровод)") > -1) { checkBox12.Checked = true; }
            if (record.Rwater_supply.IndexOf("(колодец)") > -1) { checkBox11.Checked = true; }
            if (record.Rwater_supply.IndexOf("(АГВ)") > -1) { checkBox10.Checked = true; }
            if (record.Rwater_supply.IndexOf("(ТЭЦ)") > -1) { checkBox14.Checked = true; }
            if (record.Rwater_supply.IndexOf("нет") > -1) { checkBox9.Checked = true; }
            if (record.Rwater_supply.IndexOf("(бойлер)") > -1) { checkBox13.Checked = true; }

            textBox5.Text = record.Rprice.ToString();
            textBox6.Text = record.Rrent_price_day.ToString();
            textBox7.Text = record.Rrent_price_month.ToString();
            textBox23.Text = record.Rtrade_price.ToString();
            //item.Ragent_code = result.Rows[0][48].ToString();

            listBox2.Items.Clear();
            listView1.Items.Clear();

            if (rent)
            {
                textBox6.Enabled = true;
                textBox7.Enabled = true;

                checkBox3.Visible = false;
                checkBox3.Enabled = false;
                freezer.Left = 497;
                freezer.Top = 551;
                freezer.Visible = true;
                freezer.Enabled = true;
            }
            else
            {
                textBox6.Enabled = false;
                textBox7.Enabled = false;

                checkBox3.Visible = true;
                checkBox3.Left = 497;
                checkBox3.Top = 551;
                checkBox3.Enabled = true;
                freezer.Visible = false;
                freezer.Enabled = false;
            }

            for (int i = 0; i < dbvals.photolist.Count; i++)
            { listBox2.Items.Add(dbvals.photolist[i]); }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0) { listBox2.SelectedIndex = 1; }
            pictureEdit1.Image = (dbvals.photolist[1] as Img).Picture;
        }
예제 #4
0
        public editform()
        {
            InitializeComponent();
            dbvals = new Photos("");
            dbw    = new DBWrap();
            record = new estaterecord();
            dbw.LoadAddressBase();
            dbcomm    = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            foreach (string value in dbw.balconyValues)
            {
                balcony.Properties.Items.Add(value, CheckState.Unchecked, true);
            }
            foreach (string value in dbw.loggiaValues)
            {
                loggia.Properties.Items.Add(value, CheckState.Unchecked, true);
            }

            comboBox5.Items.AddRange(dbw.housetypeValues);
            comboBox5.SelectedIndex = 12;
            comboBox6.Items.AddRange(dbw.wallValues);
            comboBox6.SelectedIndex = 1;
            comboBox7.Items.AddRange(dbw.roomlayoutValues);
            comboBox7.SelectedIndex = 4;
            comboBox14.Items.AddRange(dbw.phoneValues);
            comboBox14.SelectedIndex = 0;
            // comboBox15.Items.AddRange(roomlayoutValues);
            //  comboBox15.SelectedIndex = 4;
            comboBox12.Items.AddRange(dbw.conditionValues);
            comboBox12.SelectedIndex = 1;
            comboBox8.Items.AddRange(dbw.maindoorValues);
            comboBox8.SelectedIndex = 1;
            comboBox13.Items.AddRange(dbw.propertyValues);
            comboBox13.SelectedIndex = 7;
            comboBox9.Items.AddRange(dbw.windowValues);
            comboBox9.SelectedIndex = 4;
            comboBox10.Items.AddRange(dbw.doorValues);
            comboBox10.SelectedIndex = 0;
            comboBox11.Items.AddRange(dbw.sewerageValues);
            comboBox11.SelectedIndex = 0;
            comboBox16.Items.AddRange(dbw.tubeValues);
            comboBox16.SelectedIndex = 2;
            comboBox19.Items.AddRange(dbw.estateValues);
            comboBox19.SelectedIndex = 0;
            comboBox17.Items.AddRange(dbw.operationValues);
            comboBox17.SelectedIndex = 0;
            comboBox18.Items.AddRange(dbw.stateValues);
            comboBox18.SelectedIndex = 0;

            textBox9.Text  = "1";
            textBox8.Text  = "1";
            textBox10.Text = "1";
            textBox11.Text = "1";

            textBox12.Text = "0";
            textBox13.Text = "0";
            textBox14.Text = "0";
            textBox15.Text = "0";
            textBox16.Text = "2.5";


            // Specify the separator character.
            balcony.Properties.SeparatorChar = ',';
            loggia.Properties.SeparatorChar  = ',';
            listBox2.Items.Clear();
            for (int i = 0; i < dbvals.photolist.Count; i++)
            {
                listBox2.Items.Add(dbvals.photolist[i]);
            }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0)
            {
                listBox2.SelectedIndex = 1;
            }
            if (dbvals.photolist.Count > 0)
            {
                pictureEdit1.Image = (dbvals.photolist[0] as Img).Picture;
            }
            comboBox2.DataSource     = dbw.district;
            comboBox2.DisplayMember  = dbw.district.Columns[1].ColumnName;
            comboBox3.DataSource     = dbw.town;
            comboBox3.DisplayMember  = dbw.town.Columns[1].ColumnName;
            comboBox4.DataSource     = dbw.street;
            comboBox4.DisplayMember  = dbw.street.Columns[0].ColumnName;
            comboBox2.SelectedIndex  = 0;
            comboBox3.SelectedIndex  = 2;
            comboBox4.SelectedIndex  = 0;
            comboBox2.BindingContext = this.BindingContext;
            comboBox3.BindingContext = this.BindingContext;
            comboBox4.BindingContext = this.BindingContext;
        }
예제 #5
0
        //int operation;

        public editform(string id, bool rent, bool isadmin)
        {
            InitializeComponent();
            dbvals = new Photos("http://tamarrra.net/img1/esterne201755292010175841_big.jpg;http://tamarrra.net/img1/esterne201755302010175843_big.jpg;http://tamarrra.net/img1/esterne201755312010175845_big.jpg");
            dbw    = new DBWrap();
            estaterecord record = dbw.ReadEstate(id);

            dbw.LoadAddressBase();
            dbcomm    = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            rieltorname.Text  = record.Ragent_code;
            buildingtype.Text = record.Rhouse_type;
            material.Text     = record.Rwalling_type;
            planning.Text     = record.Rroom_layout;
            phone.Text        = record.Rtelephone;
            condition.Text    = record.Rcondition2;
            maindoor.Text     = record.Rfront_door_type;
            ownertype.Text    = record.Rproperty_type;
            windows.Text      = record.Rwindow_material;
            doors.Text        = record.Rinterior_door_type;
            canalization.Text = record.Rsewerage;
            tubes.Text        = record.Rtubing_material;
            code.Text         = record.Restate_type;
            label89.Text      = record.Roperation;
            label91.Text      = record.Rstatus;

            dateTimePicker3.Value = record.Rdate_add;
            dateTimePicker4.Value = record.Rdate_change;
            dateTimePicker6.Value = record.Rtrade_date;

            dateTimePicker3.Enabled = false;
            dateTimePicker4.Enabled = false;
            dateTimePicker6.Enabled = false;

            floor.Text      += record.Rfloor.ToString();
            rooms.Text       = record.Rroom_quantity.ToString();
            totalfloor.Text += record.Rnumber_of_storeys.ToString();
            label70.Text     = record.Rlevel_quantity.ToString();

            totalarea.Text   = record.Rtotal_floor_space.ToString() + " м2";
            livingarea.Text  = record.Rfloor_space.ToString() + " м2";
            hallarea.Text    = record.Rhall_floor_space + " м2";
            kitchenarea.Text = record.Rkitchen_floor_space + " м2";
            high.Text        = record.Rceiling_height + " м";

            district.Text = record.Rdistrict_region + " ," + record.Rcity;
            if (record.Rblock_no == "")
            {
                street.Text = record.Rstreet + " ," + func.Decrypt(record.Rhouse_no, func.fkey);
            }
            else
            {
                street.Text = record.Rstreet + " ," + func.Decrypt(record.Rhouse_no, func.fkey) + "/" + func.Decrypt(record.Rblock_no, func.fkey);
            }
            orient.Text = func.Decrypt(record.Rflat_no, func.fkey);

            if (record.Rhaggle == 1)
            {
                checkBox47.Checked = true;
            }
            if (record.Ruse_for_office == 1)
            {
                checkBox48.Checked = true;
            }
            if (record.Rparking == 1)
            {
                checkBox45.Checked = true;
            }
            if (record.Routhouse_legality == 1)
            {
                checkBox46.Checked = true;
            }
            if (record.RFridge == 1)
            {
                checkBox26.Checked = true;
            }

            if (rent)
            {
                checkBox46.Visible = false;
                checkBox26.Visible = true;
                checkBox46.Enabled = false;
                checkBox26.Enabled = true;
                checkBox26.Left    = 530;
                checkBox26.Top     = 51;
            }
            else
            {
                checkBox46.Visible = true;
                checkBox26.Visible = false;
                checkBox46.Enabled = true;
                checkBox26.Enabled = false;
                checkBox46.Left    = 530;
                checkBox46.Top     = 51;
            }

            bath.Text     = record.Rbathroom_note;
            kitchen.Text  = record.Rkitchen_note;
            backroom.Text = record.Rbackrooms;
            stuff.Text    = record.Rnote;

            description.Text = record.Rdescription_detail;

            gas.Text     = record.Rgas_supply;
            warm.Text    = record.Rheat_supply;
            water.Text   = record.Rwater_supply;
            balcon.Text  = record.Rbalcony;
            logja.Text   = record.Rloggia;
            lootype.Text = record.Rbathroom;

            price.Text = record.Rprice.ToString();
            if (rent)
            {
                dayprice.Text   = record.Rrent_price_day.ToString();
                monthprice.Text = record.Rrent_price_month.ToString();
            }
            else
            {
                dayprice.Visible   = false;
                monthprice.Visible = false;
                label76.Visible    = false;
                label77.Visible    = false;
            }
            label81.Text = record.Rtrade_price.ToString();
            //item.Ragent_code = result.Rows[0][48].ToString();

            listBox2.Items.Clear();
            listView1.Items.Clear();

            for (int i = 0; i < dbvals.photolist.Count; i++)
            {
                listBox2.Items.Add(dbvals.photolist[i]);
            }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0)
            {
                listBox2.SelectedIndex = 1;
            }
            pictureEdit1.Image = (dbvals.photolist[1] as Img).Picture;

            simpleButton3.Visible = false;
            simpleButton4.Visible = false;
            simpleButton8.Visible = false;
            checkBox25.Visible    = false;
            textBox21.Enabled     = false;

            addphotos.Visible     = false;
            simpleButton7.Visible = false;
        }
예제 #6
0
        public editform(string id, bool rent)
        {
            InitializeComponent();
            dbvals = new Photos("http://tamarrra.net/img1/esterne201755292010175841_big.jpg;http://tamarrra.net/img1/esterne201755302010175843_big.jpg;http://tamarrra.net/img1/esterne201755312010175845_big.jpg");
            dbw    = new DBWrap();
            estaterecord record = dbw.ReadEstate(id);

            dbw.LoadAddressBase();
            dbcomm    = new Comments();
            newrecord = true;
            dbvals.LoadImagesFromURLs();

            foreach (string value in dbw.balconyValues)
            {
                balcony.Properties.Items.Add(value, CheckState.Unchecked, true);
            }
            foreach (string value in dbw.loggiaValues)
            {
                loggia.Properties.Items.Add(value, CheckState.Unchecked, true);
            }

            // Specify the separator character.
            balcony.Properties.SeparatorChar = ',';
            loggia.Properties.SeparatorChar  = ',';

            comboBox5.Items.AddRange(dbw.housetypeValues);
            for (int i = 0; i < dbw.housetypeValues.Length; i++)
            {
                if (record.Rhouse_type == dbw.housetypeValues[i])
                {
                    comboBox5.SelectedIndex = i; i = dbw.housetypeValues.Length;
                }
            }

            comboBox6.Items.AddRange(dbw.wallValues);
            for (int i = 0; i < dbw.wallValues.Length; i++)
            {
                if (record.Rwalling_type == dbw.wallValues[i])
                {
                    comboBox6.SelectedIndex = i; i = dbw.wallValues.Length;
                }
            }

            comboBox7.Items.AddRange(dbw.roomlayoutValues);
            for (int i = 0; i < dbw.roomlayoutValues.Length; i++)
            {
                if (record.Rroom_layout == dbw.roomlayoutValues[i])
                {
                    comboBox7.SelectedIndex = i; i = dbw.roomlayoutValues.Length;
                }
            }

            comboBox14.Items.AddRange(dbw.phoneValues);
            for (int i = 0; i < dbw.phoneValues.Length; i++)
            {
                if (record.Rtelephone == dbw.phoneValues[i])
                {
                    comboBox14.SelectedIndex = i; i = dbw.phoneValues.Length;
                }
            }

            comboBox12.Items.AddRange(dbw.conditionValues);
            for (int i = 0; i < dbw.conditionValues.Length; i++)
            {
                if (record.Rcondition2 == dbw.conditionValues[i])
                {
                    comboBox12.SelectedIndex = i; i = dbw.conditionValues.Length;
                }
            }

            comboBox8.Items.AddRange(dbw.maindoorValues);
            for (int i = 0; i < dbw.maindoorValues.Length; i++)
            {
                if (record.Rfront_door_type == dbw.maindoorValues[i])
                {
                    comboBox8.SelectedIndex = i; i = dbw.maindoorValues.Length;
                }
            }

            comboBox13.Items.AddRange(dbw.propertyValues);
            for (int i = 0; i < dbw.propertyValues.Length; i++)
            {
                if (record.Rproperty_type == dbw.propertyValues[i])
                {
                    comboBox13.SelectedIndex = i; i = dbw.propertyValues.Length;
                }
            }

            comboBox9.Items.AddRange(dbw.windowValues);
            for (int i = 0; i < dbw.windowValues.Length; i++)
            {
                if (record.Rwindow_material == dbw.windowValues[i])
                {
                    comboBox9.SelectedIndex = i; i = dbw.windowValues.Length;
                }
            }

            comboBox10.Items.AddRange(dbw.doorValues);
            for (int i = 0; i < dbw.doorValues.Length; i++)
            {
                if (record.Rinterior_door_type == dbw.doorValues[i])
                {
                    comboBox10.SelectedIndex = i; i = dbw.doorValues.Length;
                }
            }

            comboBox11.Items.AddRange(dbw.sewerageValues);
            for (int i = 0; i < dbw.sewerageValues.Length; i++)
            {
                if (record.Rsewerage == dbw.sewerageValues[i])
                {
                    comboBox11.SelectedIndex = i; i = dbw.sewerageValues.Length;
                }
            }

            comboBox16.Items.AddRange(dbw.tubeValues);
            for (int i = 0; i < dbw.tubeValues.Length; i++)
            {
                if (record.Rtubing_material == dbw.tubeValues[i])
                {
                    comboBox16.SelectedIndex = i; i = dbw.tubeValues.Length;
                }
            }

            comboBox19.Items.AddRange(dbw.estateValues);
            for (int i = 0; i < dbw.estateValues.Length; i++)
            {
                if (record.Restate_type == dbw.estateValues[i])
                {
                    comboBox19.SelectedIndex = i; i = dbw.estateValues.Length;
                }
            }

            comboBox17.Items.AddRange(dbw.operationValues);
            for (int i = 0; i < dbw.operationValues.Length; i++)
            {
                if (record.Roperation == dbw.operationValues[i])
                {
                    comboBox17.SelectedIndex = i; i = dbw.operationValues.Length;
                }
            }

            comboBox18.Items.AddRange(dbw.stateValues);
            for (int i = 0; i < dbw.stateValues.Length; i++)
            {
                if (record.Rstatus == dbw.stateValues[i])
                {
                    comboBox18.SelectedIndex = i; i = dbw.stateValues.Length;
                }
            }

            dateTimePicker2.Value = record.Rdate_add;
            dateTimePicker1.Value = record.Rdate_change;
            dateTimePicker5.Value = record.Rtrade_date;

            textBox9.Text  = record.Rfloor.ToString();
            textBox8.Text  = record.Rroom_quantity.ToString();
            textBox10.Text = record.Rnumber_of_storeys.ToString();
            textBox11.Text = record.Rlevel_quantity.ToString();

            textBox12.Text = record.Rtotal_floor_space.ToString();
            textBox13.Text = record.Rfloor_space.ToString();
            textBox14.Text = record.Rhall_floor_space;
            textBox15.Text = record.Rkitchen_floor_space;
            textBox16.Text = record.Rceiling_height;

            comboBox2.DataSource     = dbw.district;
            comboBox2.DisplayMember  = dbw.district.Columns[1].ColumnName;
            comboBox3.DataSource     = dbw.town;
            comboBox3.DisplayMember  = dbw.town.Columns[1].ColumnName;
            comboBox4.DataSource     = dbw.street;
            comboBox4.DisplayMember  = dbw.street.Columns[0].ColumnName;
            comboBox2.SelectedIndex  = 0;
            comboBox3.SelectedIndex  = 2;
            comboBox4.SelectedIndex  = 0;
            comboBox2.BindingContext = this.BindingContext;
            comboBox3.BindingContext = this.BindingContext;
            comboBox4.BindingContext = this.BindingContext;

            for (int i = 0; i < dbw.district.Rows.Count; i++)
            {
                if (dbw.district.Rows[i][0].ToString() == record.Rdistrict_region)
                {
                    comboBox2.SelectedIndex = i; i = dbw.district.Rows.Count;
                }
            }

            for (int i = 0; i < dbw.town.Rows.Count; i++)
            {
                if (dbw.town.Rows[i][0].ToString() == record.Rcity)
                {
                    comboBox3.SelectedIndex = i; i = dbw.town.Rows.Count;
                }
            }

            int street_count = dbw.street.Rows.Count;

            for (int i = 0; i < street_count; i++)
            {
                if (dbw.street.Rows[i][1].ToString() == record.Rstreet)
                {
                    comboBox4.SelectedIndex = i; i = dbw.street.Rows.Count;
                }
            }

            if (record.Rblock_no != "")
            {
                textBox3.Text = String.Concat(func.Decrypt(record.Rhouse_no, func.fkey), "/", func.Decrypt(record.Rblock_no, func.fkey));
            }
            else
            {
                textBox3.Text = func.Decrypt(record.Rhouse_no, func.fkey);
            }
            textBox4.Text = func.Decrypt(record.Rflat_no, func.fkey);

            if (record.Rhaggle == 1)
            {
                checkBox2.Checked = true;
            }
            if (record.Ruse_for_office == 1)
            {
                checkBox1.Checked = true;
            }
            if (record.Rparking == 1)
            {
                checkBox4.Checked = true;
            }
            if (record.Routhouse_legality == 1)
            {
                checkBox3.Checked = true;
            }
            if (record.RFridge == 1)
            {
                freezer.Checked = true;
            }

            textBox20.Text = record.Rbathroom_note;
            textBox19.Text = record.Rkitchen_note;
            textBox18.Text = record.Rbackrooms;
            textBox22.Text = record.Rnote;
            textBox17.Text = record.Rdescription_detail;

            if (record.Rbalcony.IndexOf("Застеклен") > -1)
            {
                balcony.Properties.Items[0].CheckState = CheckState.Checked;
            }
            if (record.Rbalcony.IndexOf("Не застеклен") > -1)
            {
                balcony.Properties.Items[1].CheckState = CheckState.Checked;
            }
            if (record.Rbalcony.IndexOf("Зарешечен") > -1)
            {
                balcony.Properties.Items[2].CheckState = CheckState.Checked;
            }

            if (record.Rloggia.IndexOf("Застеклена") > -1)
            {
                loggia.Properties.Items[0].CheckState = CheckState.Checked;
            }
            if (record.Rloggia.IndexOf("Не застеклена") > -1)
            {
                loggia.Properties.Items[1].CheckState = CheckState.Checked;
            }
            if (record.Rloggia.IndexOf("Зарешечена") > -1)
            {
                loggia.Properties.Items[2].CheckState = CheckState.Checked;
            }

            if (record.Rgas_supply.IndexOf("природный") > -1)
            {
                checkBox5.Checked = true;
            }
            if (record.Rgas_supply.IndexOf("баллонный") > -1)
            {
                checkBox6.Checked = true;
            }
            if (record.Rgas_supply.IndexOf("электроплита") > -1)
            {
                checkBox7.Checked = true;
            }
            if (record.Rgas_supply.IndexOf("нет") > -1)
            {
                checkBox8.Checked = true;
            }

            if (record.Rheat_supply.IndexOf("электрическое") > -1)
            {
                checkBox17.Checked = true;
            }
            if (record.Rheat_supply.IndexOf("автономное") > -1)
            {
                checkBox18.Checked = true;
            }
            if (record.Rheat_supply.IndexOf("нет") > -1)
            {
                checkBox19.Checked = true;
            }
            if (record.Rheat_supply.IndexOf("ТЭЦ") > -1)
            {
                checkBox20.Checked = true;
            }

            if (record.Rbathroom.IndexOf("электрическое") > -1)
            {
                checkBox17.Checked = true;
            }
            if (record.Rbathroom.IndexOf("автономное") > -1)
            {
                checkBox18.Checked = true;
            }
            if (record.Rbathroom.IndexOf("Отсутствует") > -1)
            {
                checkBox21.Checked = true;
            }
            if (record.Rbathroom.IndexOf("Только") > -1)
            {
                checkBox22.Checked = true;
            }
            if (record.Rbathroom.IndexOf("Совмещенный") > -1)
            {
                checkBox16.Checked = true;
            }
            if (record.Rbathroom.IndexOf("Раздельный") > -1)
            {
                checkBox15.Checked = true;
            }

            if (record.Rwater_supply.IndexOf("(водопровод)") > -1)
            {
                checkBox12.Checked = true;
            }
            if (record.Rwater_supply.IndexOf("(колодец)") > -1)
            {
                checkBox11.Checked = true;
            }
            if (record.Rwater_supply.IndexOf("(АГВ)") > -1)
            {
                checkBox10.Checked = true;
            }
            if (record.Rwater_supply.IndexOf("(ТЭЦ)") > -1)
            {
                checkBox14.Checked = true;
            }
            if (record.Rwater_supply.IndexOf("нет") > -1)
            {
                checkBox9.Checked = true;
            }
            if (record.Rwater_supply.IndexOf("(бойлер)") > -1)
            {
                checkBox13.Checked = true;
            }

            textBox5.Text  = record.Rprice.ToString();
            textBox6.Text  = record.Rrent_price_day.ToString();
            textBox7.Text  = record.Rrent_price_month.ToString();
            textBox23.Text = record.Rtrade_price.ToString();
            //item.Ragent_code = result.Rows[0][48].ToString();

            listBox2.Items.Clear();
            listView1.Items.Clear();

            if (rent)
            {
                textBox6.Enabled = true;
                textBox7.Enabled = true;

                checkBox3.Visible = false;
                checkBox3.Enabled = false;
                freezer.Left      = 497;
                freezer.Top       = 551;
                freezer.Visible   = true;
                freezer.Enabled   = true;
            }
            else
            {
                textBox6.Enabled = false;
                textBox7.Enabled = false;

                checkBox3.Visible = true;
                checkBox3.Left    = 497;
                checkBox3.Top     = 551;
                checkBox3.Enabled = true;
                freezer.Visible   = false;
                freezer.Enabled   = false;
            }

            for (int i = 0; i < dbvals.photolist.Count; i++)
            {
                listBox2.Items.Add(dbvals.photolist[i]);
            }
            listBox2.DisplayMember = "Name";
            if (listBox2.Items.Count > 0)
            {
                listBox2.SelectedIndex = 1;
            }
            pictureEdit1.Image = (dbvals.photolist[1] as Img).Picture;
        }