Ejemplo n.º 1
0
 public bool insertChamCong(DTO_ChamCong chamcong)
 {
     try
     {
         conn.Open();
         SqlCommand cmd = new SqlCommand();
         cmd.Connection  = conn;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "sp_InsertDataIntoChamCong";
         cmd.Parameters.AddWithValue("maCC", chamcong.maCC);
         cmd.Parameters.AddWithValue("maNV", chamcong.maNV);
         cmd.Parameters.AddWithValue("thoiGian", chamcong.thoiGian);
         cmd.Parameters.AddWithValue("chuThich", chamcong.chuThich);
         if (cmd.ExecuteNonQuery() > 0)
         {
             return(true);
         }
     }
     catch (Exception)
     {
     }
     finally
     {
         conn.Close();
     }
     return(false);
 }
Ejemplo n.º 2
0
 private void btLuu_Click(object sender, EventArgs e)
 {
     if (txtMaCC.Text != "" || cmbMaNV.Text != "" || txtChuthich.Text != "")
     {
         DTO_ChamCong chamcong = new DTO_ChamCong(txtMaCC.Text, cmbMaNV.Text, dTPThoigian.Value, txtChuthich.Text);
         if (busChamCong.InsertChamCong(chamcong))
         {
             MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             LoadGridView_ChamCong();
             CloseTextbox();
         }
     }
     else
     {
         MessageBox.Show("Xin hãy nhập đầy đủ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 3
0
 public bool InsertChamCong(DTO_ChamCong chamcong)
 {
     return(dalChamCong.insertChamCong(chamcong));
 }