Exemplo n.º 1
0
        private void butluu_Click(object sender, EventArgs e)
        {
            if (txtma.Text == "" || txtten.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin");
                return;
            }
            Nxb n = new Nxb();

            n.manxb  = txtma.Text;
            n.tennxb = txtten.Text;
            n.diachi = txtdc.Text;
            if (MessageBox.Show(string.Format("lưu nhà xuất bản đi "), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.InsertProfile(n) > 0)
                {
                    MessageBox.Show("Đã lưu rồi nhé");
                    nhaxuatban_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("lỗi rồi à");
                }
            }
        }
Exemplo n.º 2
0
        private void butxoa_Click(object sender, EventArgs e)
        {
            if (txtma.Text == "" || txtten.Text == "")
            {
                MessageBox.Show("Chưa chọn thông tin");
                return;
            }
            Nxb n = new Nxb();

            n.manxb  = txtma.Text;
            n.tennxb = txtten.Text;
            n.diachi = txtdc.Text;
            if (MessageBox.Show(string.Format("Xóa nhà xuất bản"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.DeleteProfile(n) > 0)
                {
                    MessageBox.Show("Đã xóa");
                    nhaxuatban_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("sai rồi xóa sao duoc");
                }
            }
        }
Exemplo n.º 3
0
        private void butsua_Click(object sender, EventArgs e)
        {
            if (txtma.Text == "" || txtten.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin");
                return;
            }
            Nxb n = new Nxb();

            n.manxb  = txtma.Text;
            n.tennxb = txtten.Text;
            n.diachi = txtdc.Text;
            if (MessageBox.Show(string.Format("sửa nxb"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.UpdateProfile(n) > 0)
                {
                    MessageBox.Show("Đã sửa");
                    nhaxuatban_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Thông tin chưa được sửa");
                }
            }
        }
Exemplo n.º 4
0
 public static int DeleteProfile(Nxb n)
 {
     SqlParameter[] para = new SqlParameter[] {
         new SqlParameter("@ma", n.manxb),
         new SqlParameter("@ten", n.tennxb)
     };
     return(DataProvider.ExecuteNonQuery("xoaNXB", para));
 }
Exemplo n.º 5
0
 public static int InsertProfile(Nxb n)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", n.manxb),
         new SqlParameter("@ten", n.tennxb),
         new SqlParameter("@diachi", n.diachi)
     };
     return(DataProvider.ExecuteNonQuery("themNXB", para));
 }
Exemplo n.º 6
0
 public static int DeleteProfile(Nxb n)
 {
     return(Dao.DeleteProfile(n));
 }
Exemplo n.º 7
0
 public static int UpdateProfile(Nxb n)
 {
     return(Dao.UpdateProfile(n));
 }
Exemplo n.º 8
0
 public static int InsertProfile(Nxb n)
 {
     return(Dao.InsertProfile(n));
 }