Пример #1
0
        public void nhapdiem()
        {
            hocsinh hs = new hocsinh();

            Console.Write("nhap ma hoc sinh: ");
            hs.Mahs = Console.ReadLine();
            Console.Write("nhap diem toan: ");
            dtoan = double.Parse(Console.ReadLine());
            Console.Write("nhap diem van: ");
            dvan = double.Parse(Console.ReadLine());
            Console.Write("nhap diem ngoai ngu: ");
            dngoaingu = double.Parse(Console.ReadLine());
            Console.Write("nhap diem lich su: ");
            dlsu = double.Parse(Console.ReadLine());
            Console.Write("nhap diem dia ly: ");
            ddialy = double.Parse(Console.ReadLine());
            Console.Write("nhap diem giao duc cong dan: ");
            dgdcd = double.Parse(Console.ReadLine());
            Console.Write("nhap diem vat ly: ");
            dvatly = double.Parse(Console.ReadLine());
            Console.Write("nhap diem hoa hoc: ");
            dhoahoc = double.Parse(Console.ReadLine());
            Console.Write("nhap diem sinh hoc: ");
            dsinhhoc = double.Parse(Console.ReadLine());
            Console.Write("nhap diem the duc: ");
            dtheduc = double.Parse(Console.ReadLine());
            Console.Write("nhap diem giao duc quoc phong: ");
            dgdqp = double.Parse(Console.ReadLine());
            Console.Write("nhap doem tin hoc: ");
            dtin = double.Parse(Console.ReadLine());
            Console.Write("nhap diem cong nghe: ");
            dcnghe = double.Parse(Console.ReadLine());
        }
Пример #2
0
 internal static int DeleteProfile(hocsinh h)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", h.mahs)
     };
     return(DataProvider.ExecuteNonQuery("xoahocsinh", para));
 }
Пример #3
0
 public static int UpdateProfile(hocsinh h)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", h.mahs),
         new SqlParameter("@malh", h.malh),
         new SqlParameter("@dc", h.diachi)
     };
     return(DataProvider.ExecuteNonQuery("suahocsinh", para));
 }
Пример #4
0
 public static int InsertProfile(hocsinh h)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", h.mahs),
         new SqlParameter("@malh", h.malh),
         new SqlParameter("@ten", h.tenhs),
         new SqlParameter("@dc", h.diachi),
         new SqlParameter("@dt", h.dantoc),
         new SqlParameter("@ns", h.ngaysinh),
         new SqlParameter("@gt", h.gioitinh),
         new SqlParameter("@ghichu", h.ghichu),
         new SqlParameter("@nt", h.ngaynhaphoc),
         new SqlParameter("@rt", h.ngayratruong),
         new SqlParameter("@sk", h.suckhoe)
     };
     return(DataProvider.ExecuteNonQuery("themhocsinh", para));
 }
Пример #5
0
        private void butsua_Click(object sender, EventArgs e)
        {
            if (txtma.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin!");
                return;
            }

            hocsinh h = new hocsinh();

            h.mahs         = txtma.Text;
            h.malh         = cbxmalp.Text;
            h.tenhs        = txtten.Text;
            h.diachi       = txtdc.Text;
            h.dantoc       = txtdt.Text;
            h.ngaysinh     = datens.Value;
            h.gioitinh     = txtgt.Text;
            h.ghichu       = txtghichu.Text;
            h.ngaynhaphoc  = datenh.Value;
            h.ngayratruong = datert.Value;
            h.suckhoe      = txtsk.Text;


            if (MessageBox.Show(string.Format("Bạn có muốn sửa học sinh này không?"),
                                "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.UpdateProfile(h) > 0)
                {
                    MessageBox.Show("sửa thông tin thành công!");
                    thongtinhocsinh_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("bị Lỗi thông tin !");
                }
            }
        }
Пример #6
0
 public static int DeleteProfile(hocsinh h)
 {
     return(Dao.DeleteProfile(h));
 }
Пример #7
0
 public static int UpdateProfile(hocsinh h)
 {
     return(Dao.UpdateProfile(h));
 }
Пример #8
0
 public static int InsertProfile(hocsinh h)
 {
     return(Dao.InsertProfile(h));
 }