protected void cmdCommand(object sender, Ext.Net.DirectEventArgs e)
    {
        string tc          = Convert.ToString(e.ExtraParams["tc"]);
        int    driverId    = Convert.ToInt32(e.ExtraParams["driverId"]);
        String CommandName = e.ExtraParams["command"];

        // Bus bus = new Bus();

        if (tc == "")
        {
            return;
        }
        switch (CommandName)
        {
        case "cmdUpdate":
            hdnDriverType.SetValue(driverId);
            txtdriverId.Text = driverId.ToString();
            txttc.Text       = tc;
            WindowDriver.Show();
            break;

        case "cmdDel":
            hdnDriverDelete.SetValue(tc);
            wndDeleteConfirm.Show();
            break;
        }
    }
Пример #2
0
        public static void TestSetup(string title, string path)
        {
            WindowDriver.ApplicationPath  = ApplicationSettings.GetApplicationPath(path);
            WindowDriver.ApplicationTitle = ApplicationSettings.GetApplicationTitle(title);

            if (WindowDriver.Window == null)
            {
                WindowDriver.GrabWindow();
            }
        }
    protected void btnKaydet_DirectClick(object sender, DirectEventArgs e)
    {
        if (txtnameSurname.Text == "")
        {
            X.Msg.Alert("UYARI", "Boş Alan Bırakmayınız.").Show();
            return;
        }

        if (txttc.Text == "")
        {
            X.Msg.Alert("UYARI", "Boş Alan Bırakmayınız.").Show();
            return;
        }
        if (txtbloodGroup.Text == "")
        {
            X.Msg.Alert("UYARI", "Boş Alan Bırakmayınız.").Show();
            return;
        }
        if (txtphone.Text == "")
        {
            X.Msg.Alert("UYARI", "Boş Alan Bırakmayınız.").Show();
            return;
        }
        if (txtaddress.Text == "")
        {
            X.Msg.Alert("UYARI", "Boş Alan Bırakmayınız.").Show();
            return;
        }
        DriverService service = new DriverService();

        if (txtdriverId.Text == "")
        {
            Driver driver = new Driver()
            {
                nameSurname = txtnameSurname.Text,
                tc          = txttc.Text,
                birthday    = Convert.ToDateTime(txtbirthday.Text),
                bloodGroup  = txtbloodGroup.Text,
                phone       = txtphone.Text,
                address     = txtaddress.Text,
            };
            service.saveOrUpdate(driver);
            btnGet_DirectClick(new object(), new DirectEventArgs(null));
        }
        else
        {
            Driver driver = new Driver()
            {
                driverId    = Convert.ToInt32(txtdriverId.Text),
                nameSurname = txtnameSurname.Text,
                tc          = txttc.Text,
                birthday    = Convert.ToDateTime(txtbirthday.Text),
                bloodGroup  = txtbloodGroup.Text,
                phone       = txtphone.Text,
                address     = txtaddress.Text,
            };
            service.saveOrUpdate(driver);
            btnGet_DirectClick(new object(), new DirectEventArgs(null));
        }
        txtaddress.Clear();
        txtbirthday.Clear();
        txtbloodGroup.Clear();
        txtnameSurname.Clear();
        txtphone.Clear();
        X.Msg.Alert("UYARI", "Bilgiler kayıt edilmiştir.").Show();
        WindowDriver.Hide(this.Form);
        btnGet_DirectClick(new object(), new DirectEventArgs(null));
    }
 protected void btnAddNew_DirectClick(object sender, DirectEventArgs e)
 {
     WindowDriver.Render(this.Form);
     WindowDriver.Show();
 }
Пример #5
0
 public static void TearDown()
 {
     WindowDriver.CloseApplication();
     WindowDriver.Window = null;
 }