コード例 #1
0
        private void requisitionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Requisition_Form obj = new Requisition_Form();

            obj.Show();
            Visible = false;
        }
コード例 #2
0
        private void removeEmployeeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Requisition_Form ad = new Requisition_Form();

            ad.Show();
            Visible = false;
        }
コード例 #3
0
      private void requisitionToolStripMenuItem_Click_1(object sender, EventArgs e)
      {
          Requisition_Form o = new Requisition_Form();

          o.Show();
          this.Hide();
      }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection cnn;

            cnn = new SqlConnection("Server=.\\SQLEXPRESS;Database=DTMS; Integrated Security=true");

            string id = TeacherIdComboBox.Text;

            DateTime starttime = dateTimePicker2.Value;


            DateTime endtime   = timepicker3.Value;
            TimeSpan spacetime = endtime - starttime;
            int      x         = spacetime.Hours;
            //        MessageBox.Show(x.ToString());
            DateTime startdate = dateTimePicker.Value;
            TimeSpan span      = DateTime.Today - startdate;
            int      y         = span.Days;

            //MessageBox.Show(y.ToString());


            if (id.Length == 0)
            {
                MessageBox.Show("Plz Select a Teacher ID");
            }


            else
            {
                String     Query = "insert into requisition (teacher_id,teacher_name,teacher_designation,transport_category,transport_number,driver_name,date,start_time,return_time,purpose) values ( '" + this.TeacherIdComboBox.Text + "' ,'" + this.TeacherNameTextBox.Text + "', '" + this.TeacherDesignationomboBox.Text + "','" + this.CategorycomboBox.Text + "','" + this.TransportNumberComboBox.Text + "','" + this.DriverComboBox.Text + "','" + this.dateTimePicker.Value + "','" + starttime + "','" + endtime + "','" + this.PurposeComboBox.Text + "');";
                SqlCommand cmd   = new SqlCommand(Query, cnn);
                //SqlDataReader MyReader;



                cnn.Open();
                cmd.ExecuteReader();
                this.TeacherIdComboBox.Text = string.Empty;
                //MessageBox.Show("Saved", "Result", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand);
                MessageBox.Show("saved");
            }

            Requisition_Form obj = new Requisition_Form();

            obj.Show();
            Visible = false;
        }