Example #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         curentCar = new Car(txtNumForSerch.Text);
         int             p       = Convert.ToInt32(cmbPlace.SelectedValue);
         ParkingInBranch curentp = new ParkingInBranch(p);
         curentp.Fullparking = true;
         curentt.UpdateToAccess(curentp);
         if (FillClass())
         {
             curentTable.UpdateToAccess(curentCar);
             MessageBox.Show("רכב התעדכן בהצלחה");
         }
     }
     catch
     {
         int p = Convert.ToInt32(cmbPlace.SelectedValue);
         errorProvider1.Clear();
         if (FillClass())
         {
             curentTable.AddToAccess(curentCar);
             MessageBox.Show("רכב התווסף למאגר בהצלחה");
         }
         ParkingInBranch curentp = new ParkingInBranch(p);
         curentp.Fullparking = true;
         curentt.UpdateToAccess(curentp);
     }
 }
Example #2
0
        //בסגירת הטופס החניה תתעדכן
        private void frmShowCars_FormClosed(object sender, FormClosedEventArgs e)
        {
            int             p       = Convert.ToInt32(cmbPlace.SelectedValue);
            ParkingInBranch curentp = new ParkingInBranch(p);

            curentp.Fullparking = true;
            curentt.UpdateToAccess(curentp);
        }
Example #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            //קוד חניה
            int             p       = Convert.ToInt32(cmbPlace.SelectedValue);
            ParkingInBranch curentp = new ParkingInBranch(p);

            curentp.Fullparking = true;
            curentt.UpdateToAccess(curentp);
            if (FillClass())
            {
                curentTable.UpdateToAccess(curentCar);
                MessageBox.Show("רכב התעדכן בהצלחה");
            }
        }
Example #4
0
 private void cmbPlace_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (str != "del")
     {
         try
         {
             int             placeCode = Convert.ToInt32(cmbPlace.SelectedValue);
             ParkingInBranch curentp   = new ParkingInBranch(placeCode);
             if (curentp.Fullparking == true)
             {
                 MessageBox.Show("החניה שבחרת תפוסה בחר חניה אחרת");
             }
         }
         catch { }
     }
 }
Example #5
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         curentCar = new Car(txtNumForSerch.Text);
         FillTXT();
         int             p       = Convert.ToInt32(cmbPlace.SelectedValue);
         ParkingInBranch curentp = new ParkingInBranch(p);
         curentp.Fullparking = false;
         curentt.UpdateToAccess(curentp);
         btnUpdate.Enabled = true;
         btnDel.Enabled    = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #6
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            int p = Convert.ToInt32(cmbPlace.SelectedValue);

            if (CarTable.GetIfDelId(curentCar.CarNumber))
            {
                DialogResult dres = MessageBox.Show("האם למחוק", "אזהרת מחיקה", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                if (dres == DialogResult.Yes)
                {
                    curentTable.DeleteToAccess(curentCar);
                    MessageBox.Show("רכב הוסר בהצלחה");
                    ParkingInBranch curentp = new ParkingInBranch(p);
                    curentp.Fullparking = false;
                    curentt.UpdateToAccess(curentp);
                }
            }
            else
            {
                MessageBox.Show("לא ניתן למחוק את הרכב המבוקש");
            }
        }
        private void btnok_Click(object sender, EventArgs e)
        {
            try {
                curentTake = new Takes(Convert.ToInt32(txtnumTake.Text));
                Car curentCar = new Car(curentTake.NumCar);
                curentCar.Finds = false;
                CarTable curentCarTable = new CarTable();
                curentCarTable.UpdateToAccess(curentCar);
                MessageBox.Show("תודה שהשכרתם באלבר");
                //עדכון שהחניה פנויה
                curentParking             = new ParkingInBranch(curentCar.CoudeParking);
                curentParking.Fullparking = false;
                curentParkingTable.UpdateToAccess(curentParking);
            }
            catch
            {
                MessageBox.Show("לא נמצא לקוח במאגר וודא שהקלדת נכון את ת.ז");
            }
            frmReportTakeCar f1 = new frmReportTakeCar(curentTake.NumTakes);

            f1.Show();
            this.Close();
        }
        private void  AddParking(int x, int y)
        {
            string               names;
            ParkingInBranch      curentp      = new ParkingInBranch();
            ParkingInBranchTable curentPTable = new ParkingInBranchTable();

            for (int i = 0; i < x; i++)
            {
                for (int j = 0; j <= y; j++)
                {
                    names = Convert.ToString(j);
                    curentp.CoudParking = curentPTable.GetNewKey();
                    curentp.CoudeBranch = curentBranch.BranchCoude;
                    curentp.Fullparking = false;
                    if (i == 0 && j == 0)
                    {
                        curentp.NumParking = "";
                    }
                    else
                    {
                        if (i == 0)
                        {
                            curentp.NumParking = "A/" + names;
                        }
                        if (i == 1)
                        {
                            curentp.NumParking = "B/" + names;
                        }
                        if (i == 2)
                        {
                            curentp.NumParking = "C/" + names;
                        }
                    }
                    curentPTable.AddToAccess(curentp);
                }
            }
        }