コード例 #1
0
        private void can_Submit_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            connect = new CTUConnection();

            try
            {
                if (Department == 1)
                {
                    connect.GetInvoiceNewCar(int.Parse(cmbx_SalesMan.SelectedValue.ToString()), ServicePlan, Convert.ToDateTime(DTP_Date.SelectedDate.ToString()), int.Parse(cmbx_Cust.SelectedValue.ToString()), int.Parse(cmbx_Car.SelectedValue.ToString()));
                }

                else if (Department == 2)
                {
                    connect.GetInvoiceOldCar(int.Parse(cmbx_Car.SelectedValue.ToString()), ServicePlan, Convert.ToDateTime(DTP_Date.SelectedDate.ToString()), int.Parse(cmbx_Cust.SelectedValue.ToString()), int.Parse(cmbx_Car.SelectedValue.ToString()));
                }

                else if (Department == 3)
                {
                    connect.GetInvoiceServiceCar(int.Parse(cmbx_Mech.SelectedValue.ToString()), txt_Price.Text, Convert.ToDateTime(DTP_Date.SelectedDate.ToString()), int.Parse(cmbx_Cust.SelectedValue.ToString()), txt_Prob.Text);
                }

                else if (Department == 4)
                {
                    connect.GetInvoiceParts(Convert.ToDateTime(DTP_Date.SelectedDate.ToString()), int.Parse(cmbx_Cust.SelectedValue.ToString()), int.Parse(cmbx_Parts.SelectedValue.ToString()));
                }
            }

            catch (Exception)
            {
            }
        }