Ejemplo n.º 1
0
        private void ViewdataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            String ConnString = ConfigurationManager.ConnectionStrings["PayrollConn"].ConnectionString;

            SqlConnection Conn = new SqlConnection(ConnString);

            try
            {
                String     ID  = ViewdataGridView[2, e.RowIndex].Value.ToString();
                SqlCommand cmd = new SqlCommand("SP_EmployeeExitTime", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Emp_ID", ID);
                cmd.Parameters.AddWithValue("@ExitTime", DateTime.Now.ToString());



                Conn.Open();
                cmd.ExecuteNonQuery();
                ViewdataGridView[0, e.RowIndex].Value = "Exit";
                MyConnectionMethods.NoDayUpdate();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Conn.Close();
            }
        }
Ejemplo n.º 2
0
        public void SearchAtt()
        {
            try
            {
                String ConnString = ConfigurationManager.ConnectionStrings["PayrollConn"].ConnectionString;

                SqlConnection conn = new SqlConnection(ConnString);


                using (conn)
                {
                    SqlCommand cmds = new SqlCommand("SP_getEmployeeAttendance", conn);
                    cmds.CommandType = CommandType.StoredProcedure;

                    cmds.Parameters.Add("@ID", SqlDbType.VarChar).Value = IDTB.Text;
                    cmds.Parameters.AddWithValue("@Month", GetSelected.Month(DT.Month));
                    cmds.Parameters.AddWithValue("@Year", DT.Year);
                    SqlDataAdapter sda = new SqlDataAdapter(cmds);
                    DataTable      dt  = new DataTable();

                    sda.Fill(dt);
                    ViewdataGridView.DataSource = dt;
                    GetData = dt;
                }


                MyConnectionMethods.NoDayUpdate();
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 3
0
        private void AttendanceForm_Load(object sender, EventArgs e)
        {
            MyConnectionMethods.NoDayUpdate();
            StartTimePicker.Value = DateTime.Now;
            EndTimePicker.Value   = DateTime.Now;
            if (EmployeeID != "")
            {
                IDTB.Text = EmployeeID;

                groupBox2.Hide();
            }
            SearchAtt();
        }
Ejemplo n.º 4
0
 private void EmployeeExitFormRec_Load(object sender, EventArgs e)
 {
     MyConnectionMethods.NoDayUpdate();
     SearchEmp();
 }