Пример #1
0
 public List <SV_LH> GetSV_LH(string sql)
 {
     try
     {
         SqlDataReader dr   = dp.ExecReader(sql);
         List <SV_LH>  list = new List <SV_LH>();
         int           masv;
         string        malh;
         double        diemgk, diemck;
         while (dr.Read())
         {
             masv   = dr.GetInt32(0);
             malh   = dr.GetString(1);
             diemgk = dr.GetDouble(2);
             diemck = dr.GetDouble(3);
             SV_LH slh = new SV_LH(masv, malh, diemgk, diemck);
             list.Add(slh);
         }
         return(list);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         dp.disCon();
     }
 }
Пример #2
0
        public SV_LH get1diemhocki(string sql)
        {
            try
            {
                SqlDataReader dr = dp.ExecReader(sql);

                int    masv;
                string malh;
                double diemgk, diemck;
                SV_LH  svlh;
                dr.Read();
                {
                    masv   = dr.GetInt32(0);
                    malh   = dr.GetString(1);
                    diemgk = dr.GetDouble(2);
                    diemck = dr.GetDouble(3);
                    svlh   = new SV_LH(masv, malh, diemgk, diemck);

                    return(svlh);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                dp.disCon();
            }
        }
Пример #3
0
        private void button7_Click(object sender, EventArgs e)
        {
            int    masv;
            string malh;
            double diemgk, diemck;

            masv   = int.Parse(txtmsv1.Text.Trim());
            malh   = txtmalh1.Text.Trim();
            diemgk = double.Parse(txtdiemgk.Text.Trim());
            diemck = double.Parse(txtdiemck.Text.Trim());

            SV_LH slh = new SV_LH(masv, malh, diemgk, diemck);

            try
            {
                int i = new SV_LHBus().SuaSV_LH(slh);
                if (i == -2)
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            dgvSV_LH.DataSource = GetSV_LH();
        }
Пример #4
0
 public int SuaSV_LH(SV_LH SV_LH)
 {
     try
     {
         return(new SV_LHDAO().SuaSV_LH(SV_LH));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
        public int SuaSV_LH(SV_LH SLH)
        {
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@masv", SLH.MaSV));
            list.Add(new SqlParameter("@malop", SLH.MaLop));
            list.Add(new SqlParameter("@diemgk", SLH.DiemGK));
            list.Add(new SqlParameter("@diemck", SLH.DiemCK));

            try
            {
                return(dp.ExcuteNonquery("SuaSV_LH", System.Data.CommandType.StoredProcedure, list));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
Пример #6
0
 public int ThemSV_LH(SV_LH SV_LH)
 {
     return(new DichVuSVDAO().ThemSV_LH(SV_LH));
 }