Beispiel #1
0
    protected void btnKaydet_DirectClick(object sender, DirectEventArgs e)
    {
        ShifTimeService stService = new ShifTimeService();

        if (txtshiftTimeId.Text == "")
        {
            ShiftTime sT = new ShiftTime()
            {
                departureTime = cmbdepartureTime.SelectedItem.Value.ToString(),
                plate         = new Bus()
                {
                    plate = cmbplate.SelectedItem.Text
                },
                driverId = new Driver()
                {
                    driverId = Convert.ToInt32(cmbDriver.SelectedItem.Value.ToString())
                },
                lineId = new Line()
                {
                    lineName = cmblineName.SelectedItem.Text
                },
                stiftStart = Convert.ToDateTime(txtstiftStart.Text),
                shiftEnd   = Convert.ToDateTime(txtshiftEnd.Text)
            };
            stService.Save(sT);
        }

        else
        {
            ShiftTime sT = new ShiftTime()
            {
                departureTime = cmbdepartureTime.SelectedItem.Value.ToString(),
                plate         = new Bus()
                {
                    plate = cmbplate.SelectedItem.Text
                },
                driverId = new Driver()
                {
                    driverId = Convert.ToInt32(cmbDriver.SelectedItem.Value.ToString())
                },
                lineId = new Line()
                {
                    lineName = cmblineName.SelectedItem.Text
                },
                stiftStart = Convert.ToDateTime(txtstiftStart.Text),
                shiftEnd   = Convert.ToDateTime(txtshiftEnd.Text)
            };
            stService.Save(sT);
        }
        txtshiftEnd.Clear();
        txtshiftTimeId.Clear();
        txtstiftStart.Clear();
        cmbdepartureTime.Clear();
        cmbDriver.Clear();
        cmblineName.Clear();
        cmbplate.Clear();
        X.Msg.Alert("UYARI", "Bilgiler kayıt edilmiştir.").Show();
        WindowST.Hide(this.Form);
        btnGet_DirectClick(new object(), new DirectEventArgs(null));
    }
Beispiel #2
0
 protected void btnAddNew_DirectClick(object sender, DirectEventArgs e)
 {
     WindowST.Render(this.Form);
     WindowST.Show();
 }