Пример #1
0
        private void SavePropertyBTN_Click(object sender, EventArgs e)
        {
            try
            {
                System.IO.MemoryStream ms = new System.IO.MemoryStream();
                AddPropertyImagePB.Image.Save(ms, AddPropertyImagePB.Image.RawFormat);
                byte[] arrpic = ms.GetBuffer();


                if (arrpic == null)
                {
                    ToLet.Classes.PropertyDetails pd = new Classes.PropertyDetails(AddTenantCategoryCB.SelectedItem.ToString(), AddHomeCategoryCB.SelectedItem.ToString(), AddLocationCB.SelectedItem.ToString(), AddRoomCountCB.SelectedItem.ToString(), AddDetaiedAddressTB.Text, AddAdditionalCommentsTB.Text, AddPriceTB.Text, DurationCB.SelectedItem.ToString());

                    ToLet.DBDataProvider.DBDataProvider.setProperty(pd, null, user, pass);
                }
                else
                {
                    ToLet.Classes.PropertyDetails pd = new Classes.PropertyDetails(AddTenantCategoryCB.SelectedItem.ToString(), AddHomeCategoryCB.SelectedItem.ToString(), AddLocationCB.SelectedItem.ToString(), AddRoomCountCB.SelectedItem.ToString(), AddDetaiedAddressTB.Text, AddAdditionalCommentsTB.Text, AddPriceTB.Text, DurationCB.SelectedItem.ToString());
                    ToLet.DBDataProvider.DBDataProvider.setProperty(pd, arrpic, user, pass);
                }
                m.GetData();

                this.Hide();
            }
            catch (Exception)
            {
                MessageBox.Show("Please fill up the form propely");
                /* https://www.youtube.com/watch?v=BqyAAGMfTD8 */
            }
        }
Пример #2
0
        private void MyRentsDG_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string value1 = "", value2 = "";

            foreach (DataGridViewRow row in MyRentsDG.SelectedRows)
            {
                value1 = row.Cells[2].Value.ToString();
                value2 = row.Cells[4].Value.ToString();
            }

            Classes.PropertyDetails pd = new Classes.PropertyDetails();
            pd = ToLet.DBDataProvider.DBDataProvider.getPropertyInfo(value1, value2);
            Image pic = ToLet.DBDataProvider.DBDataProvider.getPropertyPic(value1, value2);

            PropertyDetailsForm pdf    = new PropertyDetailsForm();

            pdf.textBox1.Text                = pd.TenantCategory;
            pdf.textBox2.Text                = pd.HomeCategory;
            pdf.textBox3.Text                = pd.Location;
            pdf.textBox4.Text                = pd.RoomCount;
            pdf.AddDetaiedAddressTB.Text     = pd.DetailedAddress;
            pdf.AddAdditionalCommentsTB.Text = pd.AdditionalComment;
            pdf.AddPriceTB.Text              = pd.RentRange;
            pdf.AddPropertyImagePB.Image     = pic;

            pdf.SeeRequestBTN.Hide();
            pdf.PublishBTN.Hide();
            pdf.RequestBTN.Hide();

            pdf.Show();
        }
Пример #3
0
        private void DurationCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DurationCB.SelectedIndex > -1)
            {
                property.Duration = DurationCB.SelectedItem.ToString();

                property = ToLet.DBDataProvider.DBDataProvider.getForDurResult(property);

                // PriceRangeCB.SelectedIndex = PriceRangeCB.FindStringExact(property.RentRange);
            }
            else
            {
            }
        }
        private void PublishBTN_Click(object sender, EventArgs e)
        {
            Classes.PropertyDetails pd = new Classes.PropertyDetails();

            pd.TenantCategory    = textBox1.Text;
            pd.HomeCategory      = textBox2.Text;
            pd.Location          = textBox3.Text;
            pd.RoomCount         = textBox4.Text;
            pd.DetailedAddress   = AddDetaiedAddressTB.Text;
            pd.AdditionalComment = AddAdditionalCommentsTB.Text;
            pd.RentRange         = AddPriceTB.Text;

            ToLet.DBDataProvider.DBDataProvider.setPublishedProperty(pd);

            m.GetData();

            this.Hide();
        }
        private void RequestBTN_Click(object sender, EventArgs e)
        {
            this.Hide();

            Classes.PropertyDetails pd = new Classes.PropertyDetails();

            pd.TenantCategory    = textBox1.Text;
            pd.HomeCategory      = textBox2.Text;
            pd.Location          = textBox3.Text;
            pd.RoomCount         = textBox4.Text;
            pd.DetailedAddress   = AddDetaiedAddressTB.Text;
            pd.AdditionalComment = AddAdditionalCommentsTB.Text;
            pd.RentRange         = AddPriceTB.Text;

            int propertyId = ToLet.Database.DBDataList.getRequestedProperty(pd);


            int userid = ToLet.Database.DBDataList.setReq(propertyId, m.user);
        }
Пример #6
0
        private void HomeCategoryCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (HomeCategoryCB.SelectedIndex > -1)
            {
                property.HomeCategory = HomeCategoryCB.SelectedItem.ToString();

                property = ToLet.DBDataProvider.DBDataProvider.getForHomeResult(property);


                LocationCB.SelectedIndex = LocationCB.FindStringExact(property.Location);

                // PriceRangeCB.SelectedIndex = PriceRangeCB.FindStringExact(property.RentRange);
                RoomCountCB.SelectedIndex = RoomCountCB.FindStringExact(property.RoomCount);
                DurationCB.SelectedIndex  = DurationCB.FindStringExact(property.Duration);
            }
            else
            {
            }
        }
        private void SeeRequestBTN_Click(object sender, EventArgs e)
        {
            Classes.PropertyDetails pd = new Classes.PropertyDetails();

            pd.TenantCategory    = textBox1.Text;
            pd.HomeCategory      = textBox2.Text;
            pd.Location          = textBox3.Text;
            pd.RoomCount         = textBox4.Text;
            pd.DetailedAddress   = AddDetaiedAddressTB.Text;
            pd.AdditionalComment = AddAdditionalCommentsTB.Text;
            pd.RentRange         = AddPriceTB.Text;


            Classes.User        u          = new Classes.User();
            List <int>          useridlist = new List <int>();
            List <Classes.User> cu         = new List <Classes.User>();

            useridlist = ToLet.Database.DBDataList.getRequestResult(pd);

            SearchResultForm srf = new SearchResultForm(m, pd);

            foreach (var item in useridlist)
            {
                cu.AddRange(ToLet.Database.DBDataList.getUserRequestInfo(item, srf));
            }
            srf.SeeResultDG.DataSource         = cu;
            srf.SeeResultDG.Columns[0].Visible = false;
            srf.SeeResultDG.Columns[1].Visible = false;
            srf.SeeResultDG.Columns[3].Visible = false;
            srf.SeeResultDG.Columns[4].Visible = false;
            srf.SeeResultDG.Columns[5].Visible = false;
            srf.SeeResultDG.Columns[8].Visible = false;
            srf.SeeResultDG.Columns[9].Visible = false;



            this.Hide();
            srf.Show();
        }
Пример #8
0
 public SearchResultForm(MainUI m, Classes.PropertyDetails pd)
 {
     InitializeComponent();
     this.pd = pd;
     this.m  = m;
 }