Esempio n. 1
0
        public ActionResult Index()
        {
            DBIO db = new DBIO();
            user u  = db.getObjectUser("hoa", "123");

            return(View());
        }
Esempio n. 2
0
        public ActionResult EditClass(string classID, string school, string department)
        {
            DBIO  dbio = new DBIO();
            Class c    = dbio.GetClassByID(classID);

            return(View(c));
        }
Esempio n. 3
0
        public ActionResult change()
        {
            string username = Request["a"];
            string pass     = Request["b"];
            string newpass  = Request["c"];
            string repass   = Request["d"];
            string oldpass  = ((Account)System.Web.HttpContext.Current.Session["login1"]).Pass;

            if (pass.Equals(oldpass) == false)
            {
                Session["Err"] = "Pass nhập bị sai (không giống pass cũ)";
                return(Redirect("/User/ChangePass"));
            }
            else if (newpass.Equals(repass) == false)
            {
                Session["Err"] = "kiểm tra lại new pass và repass phải giống nhau";
                return(Redirect("/User/ChangePass"));
            }
            else
            {
                Session["Err"] = "ok rồi đấy";
                DBIO d = new DBIO();
                d.Changepass(username, newpass);
                Session.Abandon();
                return(Redirect("/Home/Index"));
            }
        }
Esempio n. 4
0
        public JsonResult AddUser(FormCollection data)
        {
            string username = data["username"];
            string password = data["password"];

            JsonResult json = new JsonResult();

            if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password))
            {
                json.Data = new
                {
                    status  = "ERROR",
                    message = "Data cannot be empty"
                };
            }
            else
            {
                DBIO  db   = new DBIO();
                Users user = new Users();

                user.ID       = db.GetLatestID() + 1;
                user.username = username;
                user.password = password;
                db.AddObject(user);
                db.Save();
                json.Data = new
                {
                    status = "OK"
                };
            }

            return(Json(json, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        public ActionResult BlockAccount()
        {
            DBIO           d    = new DBIO();
            List <Account> list = d.getAllAccounts();

            return(View(list));
        }
Esempio n. 6
0
        public ActionResult AddPhim()
        {
            Random rnd      = new Random();
            int    idrandom = rnd.Next(1, 500);
            string idp      = "P" + idrandom.ToString();
            DBIO   d        = new DBIO();
            string imdb     = Request["a2"];
            string tenphim  = Request["b2"];
            string theloai  = Request["c2"];
            string poster   = Request["d2"];
            string image    = Request["g2"];;
            string dienvien = Request["e2"];
            string timepost = Request["f2"];
            string mota     = Request["h2"];
            string trailer  = Request["i2"];
            string anhdv    = Request["k2"];

            if (tenphim == null)
            {
                ViewBag.messeage1 = "Ảnh Mô tả là link từ google drive...";
            }
            else
            {
                try
                {
                    d.addPhim(idp, tenphim, theloai, driveControl(poster), dienvien, timepost, driveControl(image), mota, youtubeControl(trailer), driveControl(anhdv), imdb);
                    ViewBag.messeage1 = " Them Phim Thanh Cong ... Them tap Phim di ";
                }
                catch
                {
                    ViewBag.messeage1 = " Them Phim That Bai ... Thu Lai Sau ";
                }
            }
            return(View());
        }
Esempio n. 7
0
        public ActionResult ManagerPhim()
        {
            DBIO        d     = new DBIO();
            List <Phim> model = d.getAllFilm();

            return(View(model));
        }
Esempio n. 8
0
        public ActionResult ReturnUniversityByID(string universityID)
        {
            DBIO       dbio = new DBIO();
            University d    = dbio.GetUniversityByID(universityID);

            return(View(d));
        }
Esempio n. 9
0
        public ActionResult addTapMoi()
        {
            string        txt  = Request["idp"];
            string        link = Request["link"];
            DBIO          d    = new DBIO();
            List <cacTap> c    = d.getvideo(txt);
            int           tap  = 0;

            if (c.Count == 0)
            {
                tap = 1;
            }
            else
            {
                foreach (var item in c)
                {
                    tap = Int32.Parse(item.tap);
                }
                tap = tap + 1;
            }
            try
            {
                d.addTap(txt, tap, driveControl(link));
                ViewBag.messeage = "Add success";
            }
            catch
            {
                ViewBag.messeage = "Add Fail!!";
            }
            Phim p = d.getFilm(txt);

            return(PartialView("DataPhim", p));
        }
Esempio n. 10
0
        public ActionResult AddNew()
        {
            string title   = Request["title"];
            string content = Request["content"];
            string image   = Request["link"];

            if (title != null)
            {
                try
                {
                    DBIO d = new DBIO();
                    d.addNew(title, content, driveControl(image));
                    ViewBag.messeage = "Thêm Tin tức Thành Công...";
                }
                catch (Exception e)
                {
                    ViewBag.messeage = e.Message;
                }
            }
            else
            {
                ViewBag.messeage = "Ảnh Mô tả là link từ google drive...";
            }

            return(View());
        }
Esempio n. 11
0
    public void RateUpdate()
    {
        var read = DBIO.TrimType(_readFile.text);//ReadFile(_readFile);
        var type = JudgeDBType(read.type);
        var db   = GetDB(type);

        if (type == typeof(ItemDB))
        {
            var op = new DBOperater <ItemDBData, ItemDB>(db as ItemDB);
            op.RateUpdate();
        }
        else if (type == typeof(FlagDB))
        {
            var op = new DBOperater <FlagDBData, FlagDB>(db as FlagDB);
            op.RateUpdate();
        }
        else if (type == typeof(SkillDB))
        {
            var op = new DBOperater <SkillDBData, SkillDB>(db as SkillDB);
            op.RateUpdate();
        }
        else if (type == typeof(CharcterDB))
        {
            var op = new DBOperater <CharcterDBData, CharcterDB>(db as CharcterDB);
            op.RateUpdate();
        }
        else if (type == typeof(EnemySetDB))
        {
            var op = new DBOperater <EnemySetDBData, EnemySetDB>(db as EnemySetDB);
            op.RateUpdate();
        }
    }
Esempio n. 12
0
        public ActionResult ReturnClassByID(string classID)
        {
            DBIO  dbio   = new DBIO();
            Class cclass = dbio.GetClassByID(classID);

            return(Json(cclass, JsonRequestBehavior.AllowGet));
        }
Esempio n. 13
0
        public ActionResult EditUniversity(string universityID)
        {
            DBIO       dbio = new DBIO();
            University c    = dbio.GetUniversityByID(universityID);

            return(Json(c, JsonRequestBehavior.AllowGet));
        }
Esempio n. 14
0
        public ActionResult EditDepartment(string departmentID)
        {
            DBIO       dbio = new DBIO();
            Department c    = dbio.GetDepartmentByID(departmentID);

            return(Json(c, JsonRequestBehavior.AllowGet));
        }
Esempio n. 15
0
        public ActionResult ProfilePage()
        {
            DBIO    d        = new DBIO();
            string  username = ((Account)System.Web.HttpContext.Current.Session["login1"]).Username;
            Account a        = d.checkaccount(username);
            string  pass     = Request["old"];
            string  newpass  = Request["new"];
            string  repass   = Request["renew"];
            string  oldpass  = ((Account)System.Web.HttpContext.Current.Session["login1"]).Pass;

            if (pass == null || newpass == null || repass == null)
            {
                ViewBag.mess = "Chú Ý phải điền đầy đủ tất cả mấy cái text box kia";
                return(View(a));
            }
            else
            {
                if (pass.Equals(oldpass) == false)
                {
                    ViewBag.mess = "Nhập Mật Khẩu cũ bị sai";
                    return(View(a));
                }
                else if (newpass.Equals(repass) == false)
                {
                    ViewBag.mess = "Re-password và password Không khớp nhau";
                    return(View(a));
                }
                else
                {
                    d.Changepass(username, newpass);
                    Session.Abandon();
                    return(Redirect("/ADControl/AdminHomePage"));
                }
            }
        }
Esempio n. 16
0
        public ActionResult EditDepartment(string departmentID, string school)
        {
            DBIO       dbio = new DBIO();
            Department c    = dbio.GetDepartmentByID(departmentID);

            return(View(c));
        }
Esempio n. 17
0
        public ActionResult ReturnDepartmentByID(string departmentID)
        {
            DBIO       dbio = new DBIO();
            Department d    = dbio.GetDepartmentByID(departmentID);

            return(View(d));
        }
Esempio n. 18
0
        // GET: Home
        public ActionResult Index()
        {
            Session["Previos"] = "/Home/Index";
            DBIO             d     = new DBIO();
            List <Phim>      model = d.getAllFilm();
            PagedList <Phim> ph    = null;
            int index;

            if (Request["index"] == null)
            {
                index = 1;
            }
            else
            {
                index = int.Parse(Request["index"]);
            }
            int total = model.Count;
            int page  = total / 18;

            if (total % 18 != 0)
            {
                page++;
            }
            ViewBag.total = page;
            ViewBag.index = index;
            ph            = (PagedList <Phim>)model.ToPagedList(index, 18);
            List <Phim> topview = d.ListTopView();

            Session["topView"] = topview;
            return(View(ph));
        }
Esempio n. 19
0
        public ActionResult EditClass(string classId)
        {
            DBIO  dbio = new DBIO();
            Class c    = dbio.GetClassByID(classId);

            return(Json(c, JsonRequestBehavior.AllowGet));
        }
Esempio n. 20
0
    public void SyncDatabyTxt()
    {
        var txt  = DBIO.TrimType(_readText.text);
        var path = (isTest)? $"Test/{_readText.name}":$"Product/{_readText.name}";

        EventDataOperater.SyncDataByTxt(_EventDb, txt.replaced, path, _readText.name);
    }
Esempio n. 21
0
        public void ProcessRule(JToken jObj, XmlElement xTable, DBIO dBIO)
        {
            //we actually have a pair id so we don't need to
            //look it up
            //else look it up
            if (jObj.Value <int?>("Heading_Pair_Id") != 0)
            {
                return;
            }
            this.dBIO = dBIO;
            string ucat = jObj.Value <string>("Universal_Sub_Category");
            string qgh  = jObj.Value <string>("Question_Group_Heading");
            //lookup the pairid and set it on the jObj
            DataTable dt = findValues(ucat, qgh);

            if (dt.Rows.Count == 0)
            {
                //process any values that we know
                ucat = DataExceptions(ucat);
                dt   = findValues(ucat, qgh);
            }
            foreach (DataRow row in dt.Rows)
            {
                jObj["Heading_Pair_Id"] = row["Heading_Pair_Id"].ToString();
            }
        }
Esempio n. 22
0
        // GET: News
        public ActionResult NewPage()
        {
            Session["Previos"] = "/News/NewPage";
            DBIO            d       = new DBIO();
            List <New>      list    = d.loadNew();
            PagedList <New> pageNew = null;
            int             index;

            if (Request["index"] == null)
            {
                index = 1;
            }
            else
            {
                index = int.Parse(Request["index"]);
            }
            int total = list.Count;
            int page  = total / 4;

            if (total % 4 != 0)
            {
                page++;
            }
            ViewBag.total = page;
            ViewBag.index = index;
            pageNew       = (PagedList <New>)list.ToPagedList(index, 4);
            return(View(pageNew));
        }
Esempio n. 23
0
        public JsonResult Login(FormCollection data)
        {
            String            email    = data["email"];
            String            password = data["password"];
            DBIO              database = new DBIO();
            JsonResult        json     = new JsonResult();
            ThongTinKhachHang ttkh     = new ThongTinKhachHang();

            ttkh = database.CheckLogin(email, password);
            if (ttkh == null)
            {
                json.Data = new
                {
                    status = "er",
                };
                return(Json(json, JsonRequestBehavior.AllowGet));
            }
            Session["user"] = ttkh;

            Session.Timeout = 5; // thời gian time out là 5 phút
            json.Data       = new
            {
                status = "OK",
                name   = ttkh.Ten_Khanh_Hang,
                phone  = ttkh.Phone,
                email  = ttkh.Email,
                adress = ttkh.Adress
            };
            return(Json(json, JsonRequestBehavior.AllowGet));
        }
Esempio n. 24
0
        public ActionResult EditStudent(string studentID)
        {
            DBIO    dbio = new DBIO();
            Student stu  = dbio.GetStudentByID(studentID);

            return(View(stu));
        }
Esempio n. 25
0
        public ActionResult ReturnClassByID(string classID)
        {
            DBIO  dbio   = new DBIO();
            Class cclass = dbio.GetClassByID(classID);

            return(View(cclass));
        }
Esempio n. 26
0
        public ActionResult EditUniversity(string universityID)
        {
            DBIO       dbio = new DBIO();
            University c    = dbio.GetUniversityByID(universityID);

            return(View(c));
        }
Esempio n. 27
0
        public ActionResult DoneEditStudent(string id, string name, string date, string cclass, string school, string department)
        {
            DBIO dbio = new DBIO();

            dbio.EditStudent(id, name, date, cclass, school, department);
            ViewBag.notification = "Updated your changes";
            return(View("Notify"));
        }
Esempio n. 28
0
        public ActionResult DeleteStudent(string studentID, string school)
        {
            DBIO dbio = new DBIO();

            dbio.DeleteStudent(studentID, school);
            ViewBag.notification = "removed student with id= " + studentID;
            return(View("Notify"));
        }
Esempio n. 29
0
        public ActionResult DoneEditUniversity(string id, string name)
        {
            DBIO dbio = new DBIO();

            dbio.EditUniversity(id, name);
            ViewBag.notification = "Updated your changes";
            return(View("Notify"));
        }
Esempio n. 30
0
        public ActionResult DeleteUniversity(string id)
        {
            DBIO dbio = new DBIO();

            dbio.DeleteUniversity(id);
            ViewBag.notification = "removed university with id= " + id;
            return(View("Notify"));
        }