Example #1
0
        private void Load1(int PCode)
        {
            JTariff objTarrif = new JTariff(PCode);

            //txtEndDate.Date  = objTarrif.EndDate;
            //txtStartDate.Date  = objTarrif.StartDate;
            txtStartDate.Date         = objTarrif.Date;
            cmbShift.SelectedValue    = objTarrif.ShiftCode;
            cmbLine.SelectedValue     = objTarrif.LineCode;
            cmbBus.SelectedValue      = objTarrif.BusCode;
            personDriver.SelectedCode = objTarrif.DriverCode;
        }
Example #2
0
 private int Save()
 {
     if (Validate())
     {
         JTariff objAutoDefine = new JTariff(_Code);
         objAutoDefine.DriverCode = personDriver.SelectedCode;
         objAutoDefine.BusCode    = (int)cmbBus.SelectedValue;
         objAutoDefine.LineCode   = (int)cmbLine.SelectedValue;
         objAutoDefine.ShiftCode  = (int)cmbShift.SelectedValue;
         //objAutoDefine.StartDate = txtStartDate.Date;
         //objAutoDefine.EndDate = txtEndDate.Date;
         objAutoDefine.Date = txtStartDate.Date;
         if (State == ClassLibrary.JFormState.Insert)
         {
             _Code = objAutoDefine.Insert();
             State = ClassLibrary.JFormState.Update;
         }
         if (State == ClassLibrary.JFormState.Update)
         {
             if (objAutoDefine.Update())
             {
                 return(_Code);
             }
             else
             {
                 return(0);
             }
         }
         else
         {
             return(_Code);
         }
     }
     else
     {
         return(0);
     }
 }