Exemple #1
0
        private void LoadComboBox()
        {
            personDriver.Text         = "راننده";
            personDriver.FilterPerson = " Code IN (Select PersonCode From AUTPersonel)";

            JAUTVacation vacation = new JAUTVacation(_Code);

            BusManagment.WorkOrder.JVacationTypes types = new JVacationTypes();
            types.SetComboBox(cmbVationType, vacation.VacationType);

            if (_Code == 0)
            {
                txtFromDate.Date = (new JDataBase()).GetCurrentDateTime();
                txtToDate.Date   = txtFromDate.Date;
                txtFromTime.Text = "00:00";
                txtToTime.Text   = "23:59";
            }
            else
            {
                personDriver.Enabled = false;
            }
            if (_DriverPCode > 0)
            {
                personDriver.SelectedCode = _DriverPCode;
            }
        }
Exemple #2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (Validate())
     {
         JAUTVacation vacation = new JAUTVacation(_Code);
         vacation.Description  = txtDesc.Text;
         vacation.DriverPCode  = personDriver.SelectedCode;
         vacation.FromDate     = JDateTime.GregorianDate(txtFromDate.Text, txtFromTime.Text);
         vacation.ToDate       = JDateTime.GregorianDate(txtToDate.Text, txtToTime.Text);
         vacation.VacationType = Convert.ToInt32(cmbVationType.SelectedValue);
         if (_Code == 0)
         {
             if (vacation.Insert(_DriverPCode > 0) > 0)
             {
                 DialogResult = System.Windows.Forms.DialogResult.OK;
             }
             else
             {
                 JMessages.Error("عملیات ثبت با مشکل مواجه شده است", "");
             }
         }
         else
         {
             if (vacation.Update())
             {
                 DialogResult = System.Windows.Forms.DialogResult.OK;
             }
             else
             {
                 JMessages.Error("عملیات ثبت با مشکل مواجه شده است", "");
             }
         }
     }
 }
Exemple #3
0
        private void ShowData()
        {
            JAUTVacation vacation = new JAUTVacation(_Code);

            personDriver.SelectedCode = vacation.DriverPCode;
            txtFromDate.Date          = vacation.FromDate;
            txtFromTime.Text          = vacation.FromDate.ToString("HH:mm");
            txtToDate.Date            = vacation.ToDate;
            txtToTime.Text            = vacation.ToDate.ToString("HH:mm");
            txtDesc.Text = vacation.Description;
            cmbVationType.SelectedValue = vacation.VacationType;
        }