Exemplo n.º 1
0
 private void btn_sua_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         bool tt = false;
         if (comboBox1.SelectedItem.ToString() == "Kích Hoạt")
         {
             tt = true;
         }
         DTO_Sim ds = new DTO_Sim(txt_id.Text, comboBox2.SelectedValue.ToString(), tt);
         if (bs.Update_Sim(ds))
         {
             MessageBox.Show("Sửa Thành công ");
             dataGridView1.DataSource = bs.GetAll();
         }
         else
         {
             MessageBox.Show("Sửa Thất Bại ");
         }
     }
     else
     {
         MessageBox.Show("Vui lòng chọn Sim muốn sửa ");
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool tt = false;

            if (txt_id.Text != " " && comboBox2.SelectedValue.ToString() != " ")
            {
                if (comboBox1.SelectedItem.ToString() == "Kích Hoạt")
                {
                    tt = true;
                }
                DTO_Sim ds = new DTO_Sim(txt_id.Text, comboBox2.SelectedValue.ToString(), tt);
                if (bs.Insert_Sim(ds))
                {
                    MessageBox.Show("Thêm Thành Công ");
                    dataGridView1.DataSource = bs.GetAll();
                }
                else
                {
                    MessageBox.Show("Thêm Thất Bại");
                }
            }
        }
Exemplo n.º 3
0
 public bool Update_Sim(DTO_Sim ds)
 {
     return(dal_s.update_sim(ds));
 }
Exemplo n.º 4
0
 public bool Insert_Sim(DTO_Sim ds)
 {
     return(dal_s.INSERT_SIM(ds));
 }
Exemplo n.º 5
0
        public bool update_sim(DTO_Sim ds)
        {
            string sql = "Update " + table + " set MAKH='" + ds.Ma_kh + "', TRINHTRANG='" + ds.Tinhtrang + "' where IDSIM='" + ds.Id_sim + "'";

            return(Update(sql));
        }
Exemplo n.º 6
0
        public bool INSERT_SIM(DTO_Sim ds)
        {
            string sql = " Insert into " + table + " values('" + ds.Id_sim + "','" + ds.Ma_kh + "','" + ds.Tinhtrang + "')";

            return(Update(sql));
        }