Exemple #1
0
 private void txtEmployee_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var listMSNV = timekeepingBO.GetIdByName(txtEmployee.Text);
         if (listMSNV.Count != 0)
         {
             txtMSNV.Items.Clear();
             foreach (var item in listMSNV)
             {
                 txtMSNV.Items.Add(item);
             }
             txtMSNV.Text = listMSNV.First();
         }
         else
         {
             txtMSNV.Text = "";
             txtMSNV.Items.Clear();
         }
         DateTime date = DateTime.Parse("1" + "/" + txtMonth.Text + "/" + txtYear.Text);
         LoadDataDSByMSNV(txtMSNV.Text, date);
         txtDay.SelectedItem = "";
         if (txtEmployee.Text == "All")
         {
             btnPrint.Enabled = false;
         }
         else
         {
             btnPrint.Enabled = true;
         }
     }
     catch
     {
     }
 }
Exemple #2
0
        public void loadMSNV(string Name)
        {
            txtMSNV.Items.Clear();
            List <string> list = timekeepingBO.GetIdByName(Name);

            foreach (var item in list)
            {
                txtMSNV.Items.Add(item);
            }
            txtMSNV.Text = list.First();
        }
        private void txtEmployee_SelectedValueChanged(object sender, EventArgs e)
        {
            var listMSNV = timekeepingBO.GetIdByName(txtEmployee.Text);

            if (listMSNV.Count != 0)
            {
                txtMSNV.Items.Clear();
                foreach (var item in listMSNV)
                {
                    txtMSNV.Items.Add(item);
                }
                txtMSNV.Text = listMSNV.First();
            }
            else
            {
                txtMSNV.Text = "";
                txtMSNV.Items.Clear();
            }
            DateTime date = DateTime.Parse("1" + "/" + txtMonth.Text + "/" + txtYear.Text);

            LoadDataDSByMSNV(txtMSNV.Text, date);
            txtDay.SelectedItem = "";
        }