示例#1
0
        public static TRINHDO GetTDByMaTD(string maTD)
        {
            if (Program.KetNoi() == 0)
            {
                return(null);
            }
            SqlDataReader myReader;

            myReader = Program.ExecSqlDataReader(string.Format(KeyConst.Lenh.GetTDByMaTD, maTD));
            if (myReader == null)
            {
                return(null);
            }
            TRINHDO td = null;

            while (myReader.Read())
            {
                td = new TRINHDO()
                {
                    MATD  = myReader.GetString(0),
                    TENTD = myReader.GetString(1)
                };
            }
            myReader.Close();
            return(td);
        }
示例#2
0
        public static List <TRINHDO> GetAllTrinhDo()
        {
            if (Program.KetNoi() == 0)
            {
                return(null);
            }
            SqlDataReader myReader;

            myReader = Program.ExecSqlDataReader(KeyConst.Lenh.GetAllTrinhDo);
            if (myReader == null)
            {
                return(null);
            }
            List <TRINHDO> lstTrinhDo = new List <TRINHDO>();

            while (myReader.Read())
            {
                TRINHDO td = new TRINHDO()
                {
                    MATD  = myReader.GetString(0),
                    TENTD = myReader.GetString(1)
                };
                lstTrinhDo.Add(td);
            }
            myReader.Close();
            return(lstTrinhDo);
        }
        public void SetThongTinLop(string maLop)
        {
            lbMaLop.Text = "Mã lớp : " + maLop;
            LOP lp = Lop.GetLopByMaLop(maLop);

            if (lp != null)
            {
                MaTD = lp.TRINHDO;
                KHOA    khRow = Khoa.GetKhoaByMaKhoa(lp.MAKH);
                TRINHDO tdRow = TrinhDo.GetTDByMaTD(lp.TRINHDO);
                if (khRow != null)
                {
                    MaKhoa      = khRow.MAKH;
                    lbKhoa.Text = "Khoa : " + khRow.TENKH;
                }
                if (tdRow != null)
                {
                    lbTrinhDo.Text = "Trình độ : " + tdRow.TENTD;
                }
                lbTenLop.Text = "Tên lớp : " + lp.TENLOP;
                mONHOCTableAdapter.Connection.ConnectionString = Program.connstr;
                dtsTTN.EnforceConstraints = false;
                mONHOCTableAdapter.Fill(dtsTTN.MONHOC);

                mONHOCBindingSource.Filter = "MAKH ='" + lp.MAKH + "'";
                cbbMonHoc.DataSource       = mONHOCBindingSource;
                cbbMonHoc.DisplayMember    = "TENMH";
                cbbMonHoc.ValueMember      = "MAMH";
            }
            lbSLSV.Text = "Số lượng sinh viên : " + Lop.CountSV(maLop).ToString().Trim();
        }
        public ActionResult DeleteConfirmed(string id)
        {
            TRINHDO tRINHDO = db.TRINHDOs.Find(id);

            db.TRINHDOs.Remove(tRINHDO);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "TenTrinhDo,MaTrinhDo")] TRINHDO tRINHDO)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tRINHDO).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tRINHDO));
 }
        public ActionResult Create([Bind(Include = "TenTrinhDo,MaTrinhDo")] TRINHDO tRINHDO)
        {
            if (ModelState.IsValid)
            {
                db.TRINHDOs.Add(tRINHDO);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tRINHDO));
        }
示例#7
0
        protected void them_Click(object sender, EventArgs e)
        {
            TRINHDO tdo = new TRINHDO();

            tdo.matd  = matrinhdo.Text;
            tdo.tentd = tentrinhdo.Text;
            TRINHDOBusiness td = new TRINHDOBusiness();

            td.Insert(tdo);
            LoadTrinhdo("Q");
        }
        // GET: TRINHDOs/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TRINHDO tRINHDO = db.TRINHDOs.Find(id);

            if (tRINHDO == null)
            {
                return(HttpNotFound());
            }
            return(View(tRINHDO));
        }
示例#9
0
        public int Delete(TRINHDO ObjTRINHDO)
        {
            DataTRINHDO objData = new DataTRINHDO();

            return(objData.DataDeleteTRINHDO(ObjTRINHDO));
        }
示例#10
0
 public Thongtincanhan(int stt, string MaNV, string HoTen, DateTime NgaySinh, string GioiTinh, string PhongBan, string ChucVu, string NoiSinh, TRINHDO TD, string TenTrinhDo, CHUCVU CHUCVU)
 {
     this.STT        = stt + "";
     this.MaNV       = MaNV;
     this.HoTen      = HoTen;
     this.GioiTinh   = GioiTinh;
     this.NgaySinh   = NgaySinh;
     this.PhongBan   = PhongBan;
     this.ChucVu     = ChucVu;
     this.NoiSinh    = NoiSinh;
     this.TD         = TD;
     this.TenTrinhDo = TenTrinhDo;
     this.CHUCVU     = CHUCVU;
 }
示例#11
0
 public int DataInsertTRINHDO(TRINHDO ObjTRINHDO)
 {
     return(PDInsertTRINHDO(ObjTRINHDO.tdid, ObjTRINHDO.matd, ObjTRINHDO.tentd));
 }
示例#12
0
 public int DataUpdateTRINHDO(TRINHDO ObjTRINHDO)
 {
     return(PDUpdateTRINHDO(ObjTRINHDO.tdid, ObjTRINHDO.matd, ObjTRINHDO.tentd));
 }
示例#13
0
 public DataTable DataDetailsTRINHDO(TRINHDO ObjTRINHDO)
 {
     return(PDDetailsTRINHDO(ObjTRINHDO.tdid));
 }
示例#14
0
 public int DataDeleteTRINHDO(TRINHDO ObjTRINHDO)
 {
     return(PDDeleteTRINHDO(ObjTRINHDO.tdid));
 }
示例#15
0
        public int Insert(TRINHDO ObjTRINHDO)
        {
            DataTRINHDO objData = new DataTRINHDO();

            return(objData.DataInsertTRINHDO(ObjTRINHDO));
        }
示例#16
0
        public DataTable Details(TRINHDO ObjTRINHDO)
        {
            DataTRINHDO objData = new DataTRINHDO();

            return(objData.DataDetailsTRINHDO(ObjTRINHDO));
        }
示例#17
0
        public int Update(TRINHDO ObjTRINHDO)
        {
            DataTRINHDO objData = new DataTRINHDO();

            return(objData.DataUpdateTRINHDO(ObjTRINHDO));
        }