Ejemplo n.º 1
0
 private void btnDone_Click(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     myConfig.ID             = Convert.ToInt32(txtRCID.Text);
     myConfig.DataFinish     = dateTimePicker1.Value.Date.ToString("d");
     myConfig.PeriodsLeft    = Convert.ToInt32(upDown.Value);
     myConfig.FirstPay       = Convert.ToInt32(numericUpDown1.Value);
     myConfig.PriceAppM2     = Convert.ToDouble(txtbEditAppPrice.Text);
     myConfig.PriceComAreaM2 = Convert.ToDouble(txtbEditComPrice.Text);
     myConfig.PriceFooterM2  = Convert.ToDouble(txtbEditFooterPrice.Text);
     myConfig.PriceParking   = Convert.ToDouble(txtbEditParkingPrice.Text);
     uDB.UpdateConfig(myConfig);
     uDB.CloseCon();
     ClearBinding();
     update();
     gpEdit.Visible                = false;
     cbRC.Enabled                  = true;
     btnEdit.Enabled               = true;
     btnEditImage.Enabled          = true;
     txtbWatchAppPrice.Enabled     = true;
     txtbWatchComPrice.Enabled     = true;
     txtbWatchDateFinish.Enabled   = true;
     txtbWatchFirstPay.Enabled     = true;
     txtbWatchFooterPrice.Enabled  = true;
     txtbWatchParkingPrice.Enabled = true;
     txtbWatchPeriodsLeft.Enabled  = true;
 }
Ejemplo n.º 2
0
 private void rbSold_CheckedChanged(object sender, EventArgs e)
 {
     bl = true;
     uDB.OpenConnection();
     tComArea = uDB.SearchComArea(6, "ComArea.Sold", "", 0, 0, bl, 2);
     dgvComArea.DataSource = tComArea;
     uDB.CloseCon();
 }
Ejemplo n.º 3
0
 private void rbSold_CheckedChanged(object sender, EventArgs e)
 {
     bl = true;
     uDB.OpenConnection();
     tFooter = uDB.SearchFooter(6, "Footer.Sold", "", 0, 0, bl, 2);
     dgvFooter.DataSource = tFooter;
     uDB.CloseCon();
 }
Ejemplo n.º 4
0
 private void rbSold_CheckedChanged(object sender, EventArgs e)
 {
     bl = true;
     uDB.OpenConnection();
     tParking = uDB.SearchParking(6, "Parking.Sold", "", 0, 0, bl, 2);
     dgvParking.DataSource = tParking;
     uDB.CloseCon();
 }
Ejemplo n.º 5
0
 private void Clients_Load(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     tClient = uDB.GetTable(tname);
     dataGridSource();
     dgvClients.DataSource = tClient;
     BindingAdd();
     uDB.CloseCon();
 }
Ejemplo n.º 6
0
        private void Houses_Load(object sender, EventArgs e)
        {
            uDB.OpenConnection();
            tRC = uDB.GetTable("RC");
            DataGridSource();
            dgvRC.DataSource = tRC;
            BindingAdd();

            uDB.CloseCon();
        }
Ejemplo n.º 7
0
 private void Apps_Load(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     tApps = uDB.GetApps();
     DataGridSource();
     dgvApps.DataSource = tApps;
     BindingAdd();
     uDB.CloseCon();
 }
Ejemplo n.º 8
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     if (cbAppNum.Text != "")
     {
         if (appID != 0 && typeID != 0 && rcID != 0)
         {
             uDB.DeleteByIntNum("Apps", "ID", appID);
         }
     }
     uDB.CloseCon();
 }
Ejemplo n.º 9
0
 private void Bclient_Click(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     login = uDB.GetLogin(textBox1.Text, textBox2.Text);
     if (login.Rows[0][0].ToString() == "1")
     {
         for (int i = 0; i < 30; i++)
         {
             Thread.Sleep(30);
         }
         fm.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Incorect login or password");
     }
     uDB.CloseCon();
 }
Ejemplo n.º 10
0
 private void AddContract_Load(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     tRC                = uDB.GetTable("RC");
     cbRC.DataSource    = tRC;
     cbRC.DisplayMember = "Name";
     txtRCID.DataBindings.Add(new System.Windows.Forms.Binding("Text", tRC, "ID", true));
     txtTerm.DataBindings.Add(new System.Windows.Forms.Binding("Text", tRC, "PeriodsLeft", true));
     uDB.CloseCon();
 }
Ejemplo n.º 11
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Client myClient = new Client();
            UseDB  uDB      = new UseDB();

            myClient.Name        = txtbName.Text;
            myClient.Phone       = Convert.ToInt32(txtbPhone.Text);
            myClient.PassportSer = txtbPassSer.Text;
            myClient.PassportNum = Convert.ToInt32(txtbPassNum.Text);
            uDB.OpenConnection();
            uDB.InsertClient(myClient);
            uDB.CloseCon();
            this.Hide();
        }
Ejemplo n.º 12
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            uDB.OpenConnection();
            switch (index)
            {
            case 0:
                if (txtbClientDel.Text != "")
                {
                    int id = Convert.ToInt32(txtbClientDel.Text);
                    uDB.DeleteByIntNum(tname, "ID", id);
                }
                break;

            case 1:
                if (txtbClientDel.Text != "")
                {
                    string name = txtbClientDel.Text;
                    uDB.DeleteByString(tname, "Name", name);
                }
                break;

            case 2:
                if (txtbClientDel.Text != "")
                {
                    int phone = Convert.ToInt32(txtbClientDel.Text);
                    uDB.DeleteByIntNum(tname, "Phone", phone);
                }
                break;

            case 3:
                if (txtbClientDel.Text != "")
                {
                    int    num = Convert.ToInt32(txtbClientDel.Text);
                    string ser = txtbClientDel2.Text;
                    uDB.DeleteByPassPort(ser, num);
                }
                break;
            }
            uDB.CloseCon();
            txtbClientDel.Text = "";
            cbClientDel.Text   = "";
        }
Ejemplo n.º 13
0
        private void btnPaymentS_Click(object sender, EventArgs e)
        {
            uDB.OpenConnection();
            if (txtbPaymentS.Text != "")
            {
                switch (cbPaymentS.SelectedIndex)
                {
                case 0:
                {
                    int id = Convert.ToInt32(txtbPaymentS.Text);
                    tPayment = uDB.SearchPayment(1, "Payment.ID", "", id);
                }
                break;

                case 1:
                {
                    string name = txtbPaymentS.Text;
                    tPayment = uDB.SearchPayment(0, "Clients.Name", name, 0);
                }
                break;

                case 2:
                {
                    int id = Convert.ToInt32(txtbPaymentS.Text);
                    tPayment = uDB.SearchPayment(1, "Contract.ID", "", id);
                }
                break;

                case 3:
                {
                    string date = txtbPaymentS.Text;
                    tPayment = uDB.SearchPayment(0, "Contract.Data", date, 0);
                }
                break;

                case 4:
                {
                    string date = txtbPaymentS.Text;
                    tPayment = uDB.SearchPayment(0, "Payment.Data", date, 0);
                }
                break;
                }
            }
            dgvPayment.DataSource = tPayment;
            uDB.CloseCon();
        }
Ejemplo n.º 14
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     uDB.CloseCon();
     this.Hide();
 }
Ejemplo n.º 15
0
 private void btnAddAppType_Click(object sender, EventArgs e)
 {
     uDB.OpenConnection();
     if (txtAppTypeName.Text != "" && txtAppRoomAm.Text != "" && txtAppLiveArea.Text != "" && txtAppTotalArea.Text != "")
     {
         myType.RC_ID     = Convert.ToInt32(txtAppRcID.Text);
         myType.Typee     = txtAppTypeName.Text;
         myType.RoomAm    = Convert.ToInt32(txtAppRoomAm.Text);
         myType.LiveArea  = Convert.ToDouble(txtAppLiveArea.Text);
         myType.TotalArea = Convert.ToDouble(txtAppTotalArea.Text);
         double m2price = Convert.ToDouble(txtAppM2Price.Text);
         myType.TotalPrice = myType.TotalArea * m2price;
         myType.Object     = "App";
         myType.Picture    = pbAddImage.Image;
         uDB.InsertType(myType);
         pbAddImage.Image       = null;
         tType                  = uDB.GetAppType("App");
         dgvAppTypes.DataSource = tType;
     }
     uDB.CloseCon();
 }