Ejemplo n.º 1
0
        void loadcbb()
        {
            ManHinh mh = new ManHinh();

            cbbtenmanhinh.DataSource = mh.loadcbbtenmanhinh();
            cbbtennhom.DataSource    = mh.loadcbbtennhom();
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> PutManHinh(int id, ManHinh manHinh)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != manHinh.ID)
            {
                return(BadRequest());
            }

            db.Entry(manHinh).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ManHinhExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 3
0
        public void CapNhatManHinh(string mamanhinh, string tenmanhinh)
        {
            ManHinh mh = qlcf.ManHinhs.Where(t => t.MaManHinh == mamanhinh).FirstOrDefault();

            mh.TenManHinh = tenmanhinh;

            qlcf.SubmitChanges();
        }
Ejemplo n.º 4
0
        public ActionResult DeleteConfirmed(int id)
        {
            ManHinh manHinh = db.ManHinhs.Find(id);

            db.ManHinhs.Remove(manHinh);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        private void btnthem_Click(object sender, EventArgs e)
        {
            ManHinh mh = new ManHinh();

            mh.them(cbbtennhom.Text.Trim().ToString(), cbbtenmanhinh.Text.Trim().ToString());
            dataGridView1.DataSource = mh.loaddataG(cbbtenmanhinh.Text);
            MessageBox.Show("Thao tác thành công!");
        }
Ejemplo n.º 6
0
        public void load2()
        {
            ManHinh mh = new ManHinh();

            dataGridView2.DataSource = mh.load(manhom);
            TaiLieuu tl = new TaiLieuu();

            cbbtimkiemtheotheloai.DataSource = tl.loadcbbtentheloai();
        }
Ejemplo n.º 7
0
        public void ThemManHinh(string pMaMH, string pTenMH)
        {
            ManHinh manHinh = new ManHinh();

            manHinh.MaManHinh  = pMaMH;
            manHinh.TenManHinh = pTenMH;
            nhakhoa.ManHinhs.InsertOnSubmit(manHinh);
            nhakhoa.SubmitChanges();
        }
Ejemplo n.º 8
0
        private void btnxoa_Click(object sender, EventArgs e)
        {
            string  manhom = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            ManHinh mh     = new ManHinh();

            mh.xoa(manhom, cbbtenmanhinh.Text);
            dataGridView1.DataSource = mh.loaddataG(cbbtenmanhinh.Text);
            MessageBox.Show("Thao tác thành công!");
        }
Ejemplo n.º 9
0
        public bool Kiemtrakhoachinh(string mamanhinh)
        {
            ManHinh mh = qlcf.ManHinhs.Where(t => t.MaManHinh == mamanhinh).FirstOrDefault();

            if (mh == null)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 10
0
        public bool kiemtraMaManHinh(string mamh)
        {
            ManHinh mh = db.ManHinhs.Where(a => a.MaManHinh == mamh).FirstOrDefault();

            if (mh != null)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 11
0
        public async Task <IHttpActionResult> GetManHinh(int id)
        {
            ManHinh manHinh = await db.ManHinhs.FindAsync(id);

            if (manHinh == null)
            {
                return(NotFound());
            }

            return(Ok(manHinh));
        }
Ejemplo n.º 12
0
        public async Task <IHttpActionResult> PostManHinh(ManHinh manHinh)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ManHinhs.Add(manHinh);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = manHinh.ID }, manHinh));
        }
Ejemplo n.º 13
0
        public ActionResult Edit([Bind(Include = "ID,ManHinhSo,PortInfomaitonElectricID")] ManHinh manHinh)
        {
            int PortInfomaitonElectricID = db.Users.Where(user => user.Id == AccountID).Select(p => p.PortInfomaitonElectricID).FirstOrDefault();

            ViewBag.PortInfomaitonElectric = db.PortInfomaitonElectrics.ToList().Where(p => p.IsPublic && p.ID == PortInfomaitonElectricID);
            if (ModelState.IsValid)
            {
                db.Entry(manHinh).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(manHinh));
        }
Ejemplo n.º 14
0
    IEnumerator LoadObject()
    {
        model   = GameObject.FindGameObjectWithTag("Model");
        manHinh = model.GetComponent <ManHinh>();
        manHinh.loadingScreen.SetActive(true);
        yield return(new WaitForEndOfFrame());

        menu = model.GetComponent <Menu>();
        yield return(new WaitForSeconds(0.1f));

        eve         = model.GetComponent <Event>();
        eve.textNum = 0;
        menu.menuList.SetActive(false);
        yield return(new WaitForSeconds(0.1f));

        backGround = model.GetComponent <BackGround>();
        yield return(new WaitForSeconds(0.1f));

        tg         = model.GetComponent <ThoiGian>();
        tg.dayNow  = DateTime.Now.Day;
        tg.dayPrev = tg.dayNow - 1;
        yield return(new WaitForSeconds(0.1f));

        if (!thPlay)
        {
            calendar = GameObject.FindGameObjectWithTag("Calendar").GetComponent <CalendarController>();
            yield return(new WaitForSeconds(0.1f));

            GetSelectedDayInCal();
        }
        music = GameObject.FindGameObjectWithTag("Music").GetComponent <Music>();
        yield return(new WaitForSeconds(0.1f));

        sound            = model.GetComponent <AudioSource>();
        music.musicSound = GameObject.FindGameObjectWithTag("Music").GetComponent <AudioSource>();
        yield return(new WaitForSeconds(0.1f));

        if (!thPlay)
        {
            ThayDoiNhacNen(music.normalMusic);
        }
        yield return(new WaitForSeconds(0.1f));

        stat = model.GetComponent <PlayerStat>();
        stat.LoadStat(PlayerPrefs.GetInt("idTKCurrent"));
        gameObject.GetComponent <EventController>().LoadCotTruyen();
        yield return(new WaitForSeconds(0.1f));

        loadComplete = true;
        manHinh.loadingScreen.SetActive(false);
    }
Ejemplo n.º 15
0
        public async Task <IHttpActionResult> DeleteManHinh(int id)
        {
            ManHinh manHinh = await db.ManHinhs.FindAsync(id);

            if (manHinh == null)
            {
                return(NotFound());
            }

            db.ManHinhs.Remove(manHinh);
            await db.SaveChangesAsync();

            return(Ok(manHinh));
        }
Ejemplo n.º 16
0
        // GET: ManHinhs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ManHinh manHinh = db.ManHinhs.Find(id);

            if (manHinh == null)
            {
                return(HttpNotFound());
            }
            return(View(manHinh));
        }
Ejemplo n.º 17
0
        public bool XoaManHinh(string pMaMH)
        {
            ManHinh manHinh = nhakhoa.ManHinhs.Where(mh => mh.MaManHinh == pMaMH).FirstOrDefault();

            if (manHinh != null)
            {
                nhakhoa.ManHinhs.DeleteOnSubmit(manHinh);
                nhakhoa.SubmitChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public int DeleteManHinhs(string qMaMH)
        {
            ManHinh manHinhs = qlhh.ManHinhs.Where(t => t.MaMH == qMaMH).FirstOrDefault();

            if (manHinhs != null)
            {
                qlhh.ManHinhs.DeleteOnSubmit(manHinhs);
                qlhh.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
        public int UpdateManHinhs(string qMaMH, string qTenMH)
        {
            ManHinh manHinhs = qlhh.ManHinhs.Where(t => t.MaMH == qMaMH).FirstOrDefault();

            if (manHinhs != null)
            {
                manHinhs.TenMH = qTenMH;
                qlhh.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 20
0
        public void suaManHinh(string mamanhinh, string tenmanhinh)
        {
            if (kiemtraMaManHinh(mamanhinh))
            {
                MessageBox.Show("Mã màn hình không tồn tại.");
                return;
            }
            ManHinh mh = db.ManHinhs.Where(a => a.MaManHinh == mamanhinh).FirstOrDefault();

            if (mh != null)
            {
                mh.TenManHinh = tenmanhinh;
                db.SubmitChanges();
                MessageBox.Show("Sửa thành công.");
            }
        }
Ejemplo n.º 21
0
        public void XoaManHinh(string mamanhinh)
        {
            ManHinh          mh  = qlcf.ManHinhs.Where(t => t.MaManHinh == mamanhinh).FirstOrDefault();
            List <PhanQuyen> lst = new List <PhanQuyen>();

            foreach (PhanQuyen pq in qlcf.PhanQuyens)
            {
                if (pq.MaManHinh == mamanhinh)
                {
                    lst.Add(pq);
                }
            }
            qlcf.PhanQuyens.DeleteAllOnSubmit(lst);
            qlcf.ManHinhs.DeleteOnSubmit(mh);
            qlcf.SubmitChanges();
        }
Ejemplo n.º 22
0
        // GET: ManHinhs/Edit/5
        public ActionResult Edit(int?id)
        {
            int PortInfomaitonElectricID = db.Users.Where(user => user.Id == AccountID).Select(p => p.PortInfomaitonElectricID).FirstOrDefault();

            ViewBag.PortInfomaitonElectric = db.PortInfomaitonElectrics.ToList().Where(p => p.IsPublic && p.ID == PortInfomaitonElectricID);
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ManHinh manHinh = db.ManHinhs.Find(id);

            if (manHinh == null)
            {
                return(HttpNotFound());
            }
            return(View(manHinh));
        }
        public int AddManHinhs(string qMaMH, string qTenMH)
        {
            ManHinh manHinhs = qlhh.ManHinhs.Where(t => t.MaMH == qMaMH).FirstOrDefault();

            if (manHinhs == null)
            {
                ManHinh mh = new ManHinh();
                mh.MaMH  = qMaMH;
                mh.TenMH = qTenMH;
                qlhh.ManHinhs.InsertOnSubmit(mh);
                qlhh.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 24
0
        public void ThemmanHinh(string mamanhinh, string tenmanhinh)
        {
            ManHinh mh = new ManHinh();

            mh.MaManHinh  = mamanhinh;
            mh.TenManHinh = tenmanhinh;
            qlcf.ManHinhs.InsertOnSubmit(mh);

            foreach (NhomNhanVien tk in qlcf.NhomNhanViens)
            {
                PhanQuyen phanquyen = new PhanQuyen();
                phanquyen.MaManHinh = mamanhinh;
                phanquyen.MaNhomNV  = tk.MaNhomNV;
                phanquyen.CoQuyen   = true;
                qlcf.PhanQuyens.InsertOnSubmit(phanquyen);
            }


            qlcf.SubmitChanges();
        }
Ejemplo n.º 25
0
        public void xoaManHinh(string mamanhinh)
        {
            if (kiemtraMaManHinh(mamanhinh))
            {
                MessageBox.Show("Mã màn hình không tồn tại.");
                return;
            }
            ManHinh manhinh = db.ManHinhs.Where(a => a.MaManHinh == mamanhinh).FirstOrDefault();

            if (manhinh != null)
            {
                db.ManHinhs.DeleteOnSubmit(manhinh);
                xoaManHinhVaXoaTrongPhanQuyen(mamanhinh);
                db.SubmitChanges();
                MessageBox.Show("Xoá thành công màn hình '" + mamanhinh + "'");
                return;
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 26
0
        public void themManHinh(string mamanhinh, string tenmanhinh)
        {
            if (!kiemtraMaManHinh(mamanhinh))
            {
                MessageBox.Show("Mã màn hình đã tồn tại.");
                return;
            }
            if (string.IsNullOrEmpty(mamanhinh) || string.IsNullOrEmpty(tenmanhinh))
            {
                MessageBox.Show("Vui lòng nhập đầy đủ dữ liệu.");
                return;
            }
            ManHinh mh = new ManHinh();

            mh.MaManHinh  = mamanhinh;
            mh.TenManHinh = tenmanhinh;

            db.ManHinhs.InsertOnSubmit(mh);
            themMaManHinhVaoPhanQuyen(mamanhinh);
            MessageBox.Show("Thêm thành công.");
            db.SubmitChanges();
        }
Ejemplo n.º 27
0
        private void cbbtenmanhinh_SelectedIndexChanged(object sender, EventArgs e)
        {
            ManHinh mh = new ManHinh();

            dataGridView1.DataSource = mh.loaddataG(cbbtenmanhinh.Text);
        }