コード例 #1
0
        public ActionResult ActionEdit(TOURIS_TV_CITY cityView)
        {
            try
            {
                cityView.LAST_MODIFIED_BY   = CurrentUser.GetCurrentUserId();
                cityView.LAST_MODIFIED_TIME = CurrentUser.GetCurrentDateTime();

                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.RequestData(cityView, "City", "Edit", EnumList.IHttpMethod.Post.ToString()));
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been edited successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to edited");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to edited");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Index()
        {
            List <TOURIS_TV_USER> userRes = new List <TOURIS_TV_USER>();

            userRes = JsonConvert.DeserializeObject <List <TOURIS_TV_USER> >(ParsingObject.JsonData(null, "User", "RetrieveObjUser"));
            return(View(userRes));
        }
コード例 #3
0
        public ActionResult ActionDelete(TOURIS_TV_USER userView)
        {
            TOURIS_TV_USER userRes = new TOURIS_TV_USER();

            userRes = JsonConvert.DeserializeObject <TOURIS_TV_USER>(ParsingObject.JsonData(userView, "User", "DeleteObjUser"));
            return(View(userRes));
        }
コード例 #4
0
        public static AsicStandardStatsObject _Convert(string html, ParsingObject parsingObject)
        {
            AsicStandardStatsObject LasicColumn = new AsicStandardStatsObject();



            List <string> listTableStats = ParsingTable.Pars(html, parsingObject.MainNameTable,
                                                             parsingObject.MainTableParsingPattern);

            List <string> summaryTable = ParsingTable.Pars(html, parsingObject.AdditionalNameTable,
                                                           parsingObject.AdditionalTableParsingPattern);



            if (IsOld(listTableStats[1]))
            {
                LasicColumn = GetOldData(LasicColumn, listTableStats);
            }
            else
            {
                LasicColumn = GetNewData(LasicColumn, listTableStats);
            }



            LasicColumn.HashrateAVG = listTableStats[listTableStats.Count - 1];
            LasicColumn.DateTime    = DateTime.Now.ToString();
            LasicColumn.ElapsedTime = summaryTable[8 + 0];

            return(LasicColumn);
        }
コード例 #5
0
        public ActionResult ActionDelete(TOURIS_TV_COUNTRY countryView)
        {
            ResultStatus rs = new ResultStatus();

            try
            {
                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.JsonData(countryView, "Country", "DeleteObjCountry"));
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been deleted successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to deleted");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to deleted");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #6
0
        public ActionResult ActionDelete(int id)
        {
            try
            {
                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.RequestData(id, "City", "Delete", EnumList.IHttpMethod.Put.ToString()));
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been deleted successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to deleted");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to deleted");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #7
0
        public ActionResult ActionCreate(TOURIS_TV_MENU menuView)
        {
            try
            {
                menuView.CREATED_BY   = CurrentUser.GetCurrentUserId();
                menuView.CREATED_TIME = CurrentUser.GetCurrentDateTime();

                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.RequestData(menuView, "Menu", "Add", EnumList.IHttpMethod.Post.ToString()));
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been created successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to created");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to created");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #8
0
        public ActionResult ActionEdit(TOURIS_TV_COUNTRY countryView)
        {
            ResultStatus rs = new ResultStatus();

            try
            {
                countryView.LAST_MODIFIED_BY   = CurrentUser.GetCurrentUserId();
                countryView.LAST_MODIFIED_TIME = CurrentUser.GetCurrentDateTime();

                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.JsonData(countryView, "Country", "EditObjCountry"));
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been edited successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to edited");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to edited");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #9
0
        public ActionResult Index()
        {
            ViewBag.msgSuccess = TempData["msgSuccess"];
            ViewBag.msgError   = TempData["msgError"];
            List <TOURIS_TV_COUNTRY> countryRes = new List <TOURIS_TV_COUNTRY>();

            countryRes = JsonConvert.DeserializeObject <List <TOURIS_TV_COUNTRY> >(ParsingObject.JsonData(null, "Country", "RetrieveObjCountryList"));
            return(View(countryRes));
        }
コード例 #10
0
        public ActionResult Index()
        {
            ViewBag.msgSuccess = TempData["msgSuccess"];
            ViewBag.msgError   = TempData["msgError"];
            List <TOURIS_TV_CITY> cityRes = new List <TOURIS_TV_CITY>();

            cityRes = JsonConvert.DeserializeObject <List <TOURIS_TV_CITY> >(ParsingObject.RequestData(null, "City", "GridBind", EnumList.IHttpMethod.Get.ToString()));
            return(View(cityRes));
        }
コード例 #11
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_SOSMED sosmedView = new TOURIS_TV_SOSMED();
            TOURIS_TV_SOSMED sosmedRes  = new TOURIS_TV_SOSMED();

            sosmedView.ID = id;

            sosmedRes = JsonConvert.DeserializeObject <TOURIS_TV_SOSMED>(ParsingObject.RequestData(id, "Sosmed", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(sosmedRes));
        }
コード例 #12
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_USER userView = new TOURIS_TV_USER();
            TOURIS_TV_USER userRes  = new TOURIS_TV_USER();

            userView.ID = id;

            userRes = JsonConvert.DeserializeObject <TOURIS_TV_USER>(ParsingObject.RequestData(id, "User", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(userRes));
        }
コード例 #13
0
        public ActionResult Edit(int id)
        {
            TOURIS_TV_COUNTRY countryView = new TOURIS_TV_COUNTRY();
            TOURIS_TV_COUNTRY countryRes  = new TOURIS_TV_COUNTRY();

            countryView.ID = id;

            countryRes = JsonConvert.DeserializeObject <TOURIS_TV_COUNTRY>(ParsingObject.RequestData(id, "Country", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(countryRes));
        }
コード例 #14
0
        public ActionResult Delete(int id)
        {
            TOURIS_TV_SLIDESHOW slideshowView = new TOURIS_TV_SLIDESHOW();
            TOURIS_TV_SLIDESHOW slideshowRes  = new TOURIS_TV_SLIDESHOW();

            slideshowView.ID = id;

            slideshowRes = JsonConvert.DeserializeObject <TOURIS_TV_SLIDESHOW>(ParsingObject.RequestData(id, "Slideshow", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(slideshowRes));
        }
コード例 #15
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_VILLAGE villageView = new TOURIS_TV_VILLAGE();
            TOURIS_TV_VILLAGE villageRes  = new TOURIS_TV_VILLAGE();

            villageView.ID = id;

            villageRes = JsonConvert.DeserializeObject <TOURIS_TV_VILLAGE>(ParsingObject.RequestData(id, "Village", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(villageRes));
        }
コード例 #16
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_PROVINCE provinceView = new TOURIS_TV_PROVINCE();
            TOURIS_TV_PROVINCE provinceRes  = new TOURIS_TV_PROVINCE();

            provinceView.ID = id;

            provinceRes = JsonConvert.DeserializeObject <TOURIS_TV_PROVINCE>(ParsingObject.RequestData(id, "Province", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(provinceRes));
        }
コード例 #17
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_DISTRICT districtView = new TOURIS_TV_DISTRICT();
            TOURIS_TV_DISTRICT districtRes  = new TOURIS_TV_DISTRICT();

            districtView.ID = id;

            districtRes = JsonConvert.DeserializeObject <TOURIS_TV_DISTRICT>(ParsingObject.RequestData(id, "District", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(districtRes));
        }
コード例 #18
0
        public ActionResult Edit(int id)
        {
            TOURIS_TV_COUNTRY countryView = new TOURIS_TV_COUNTRY();
            TOURIS_TV_COUNTRY countryRes  = new TOURIS_TV_COUNTRY();

            countryView.ID = id;

            countryRes = JsonConvert.DeserializeObject <TOURIS_TV_COUNTRY>(ParsingObject.JsonData(countryView, "Country", "RetrieveObjCountry"));
            return(View(countryRes));
        }
コード例 #19
0
        public ActionResult Edit(int id)
        {
            TOURIS_TV_CONTACT_US contactUsView = new TOURIS_TV_CONTACT_US();
            TOURIS_TV_CONTACT_US contactUsRes  = new TOURIS_TV_CONTACT_US();

            contactUsView.ID = id;

            contactUsRes = JsonConvert.DeserializeObject <TOURIS_TV_CONTACT_US>(ParsingObject.RequestData(id, "ContactUs", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(contactUsRes));
        }
コード例 #20
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_CATEGORY categoryView = new TOURIS_TV_CATEGORY();
            TOURIS_TV_CATEGORY categoryRes  = new TOURIS_TV_CATEGORY();

            categoryView.ID = id;

            categoryRes = JsonConvert.DeserializeObject <TOURIS_TV_CATEGORY>(ParsingObject.RequestData(id, "Category", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(categoryRes));
        }
コード例 #21
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_CITY cityView = new TOURIS_TV_CITY();
            TOURIS_TV_CITY cityRes  = new TOURIS_TV_CITY();

            cityView.ID = id;

            cityRes = JsonConvert.DeserializeObject <TOURIS_TV_CITY>(ParsingObject.RequestData(id, "City", "GetProvinceByCountryId", EnumList.IHttpMethod.Put.ToString()));
            return(View(cityRes));
        }
コード例 #22
0
        public ActionResult Edit(int id)
        {
            TOURIS_TV_MENU menuView = new TOURIS_TV_MENU();
            TOURIS_TV_MENU menuRes  = new TOURIS_TV_MENU();

            menuView.ID = id;

            menuRes = JsonConvert.DeserializeObject <TOURIS_TV_MENU>(ParsingObject.RequestData(id, "Menu", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            return(View(menuRes));
        }
コード例 #23
0
        public ActionResult ActionEdit(TOURIS_TV_USER userView, HttpPostedFileBase postedFile)
        {
            try
            {
                string physicalPath = "";
                TOURIS_TV_USER_PROFILE userProfileView = new TOURIS_TV_USER_PROFILE();

                if (postedFile != null)
                {
                    string ImageName = System.IO.Path.GetFileName(postedFile.FileName); //file2 to store path and url
                    physicalPath = Server.MapPath("~" + Common.GetPathFolderImg() + ImageName);

                    userView.PHOTO_PATH        = Common.GetPathFolderImg() + ImageName;
                    userProfileView.PHOTO_PATH = userView.PHOTO_PATH;
                }

                userView.LAST_MODIFIED_BY   = CurrentUser.GetCurrentUserId();
                userView.LAST_MODIFIED_TIME = CurrentUser.GetCurrentDateTime();

                userProfileView.GENDER      = userView.GENDER;
                userProfileView.BORN        = userView.BORN;
                userProfileView.ADDRESS     = userView.ADDRESS;
                userProfileView.DESCRIPTION = userView.DESCRIPTION;
                userProfileView.JOB         = userView.JOB;
                userProfileView.COMPANY     = userView.COMPANY;
                userProfileView.HOBBY       = userView.HOBBY;

                userView.TOURIS_TV_USER_PROFILE.Add(userProfileView);

                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.RequestData(userView, "User", "Edit", EnumList.IHttpMethod.Post.ToString()));
                if (rs.IsSuccess)
                {
                    if (physicalPath != "")
                    {
                        postedFile.SaveAs(physicalPath);
                    }
                    rs.SetSuccessStatus("Data has been edited successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to edited");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to edited");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #24
0
        public ActionResult Edit(int id)
        {
            TOURIS_TV_CITY cityView = new TOURIS_TV_CITY();
            TOURIS_TV_CITY cityRes  = new TOURIS_TV_CITY();

            cityView.ID             = id;
            cityRes                 = JsonConvert.DeserializeObject <TOURIS_TV_CITY>(ParsingObject.RequestData(id, "City", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            ViewBag.GetCountryList  = Dropdown.GetCountryList();
            ViewBag.GetProvinceList = Dropdown.GetProvinceListByCountryId(cityRes.COUNTRY_ID);

            return(View(cityRes));
        }
コード例 #25
0
        public ActionResult Index()
        {
            DataTable dtGMap = new DataTable();
            //dtGMap = GetdtLatLong();
            List <TOURIS_TV_CATEGORY> categories = new List <TOURIS_TV_CATEGORY>();

            //slideshowRes
            ViewBag.GetSlideshow     = JsonConvert.DeserializeObject <List <TOURIS_TV_SLIDESHOW> >(ParsingObject.RequestData(null, "Slideshow", "GridBind", EnumList.IHttpMethod.Get.ToString()));
            Session["GetSosmedList"] = JsonConvert.DeserializeObject <List <TOURIS_TV_SOSMED> >(ParsingObject.RequestData(null, "Sosmed", "GridBind", EnumList.IHttpMethod.Get.ToString()));
            categories = JsonConvert.DeserializeObject <List <TOURIS_TV_CATEGORY> >(ParsingObject.RequestData(null, "Category", "GridBind", EnumList.IHttpMethod.Get.ToString()));

            return(View(categories));
        }
コード例 #26
0
        public ActionResult Detail(int id)
        {
            TOURIS_TV_SUB_CATEGORY subCategoryView = new TOURIS_TV_SUB_CATEGORY();
            TOURIS_TV_SUB_CATEGORY subCategoryRes  = new TOURIS_TV_SUB_CATEGORY();

            subCategoryView.ID = id;

            subCategoryRes = JsonConvert.DeserializeObject <TOURIS_TV_SUB_CATEGORY>(ParsingObject.RequestData(id, "SubCategory", "RetrieveData", EnumList.IHttpMethod.Put.ToString()));
            string mapUrl = subCategoryRes.ADDRESS + ". " + subCategoryRes.VILLAGE_NAME + ", " + subCategoryRes.DISTRICT_NAME + ". " + subCategoryRes.CITY_NAME + ", " + subCategoryRes.PROVINCE_NAME + ". " + subCategoryRes.COUNTRY_NAME;

            ViewBag.MapUrl = mapUrl.Replace(" ", "+");
            return(PartialView("Detail", subCategoryRes));
        }
コード例 #27
0
        public InputForm Index()
        {
            InputForm response = new InputForm();

            InputForm inf = new InputForm()
            {
                nama   = "Nama",
                alamat = "Alamat",
                notelp = "notelp"
            };

            response = JsonConvert.DeserializeObject <InputForm>(ParsingObject.JsonData(inf, "Persada", "PersadaString"));
            return(response);
        }
コード例 #28
0
ファイル: AsicStats.cs プロジェクト: VlaanH/AntStatsXamarin
        public AsicStats(SettingsData settings, ParsingObject parsingObject = default)
        {
            if (parsingObject == default)
            {
                ParsingObject = StandardData.StandardParsingObject;
            }
            else
            {
                ParsingObject = parsingObject;
            }



            Settings = settings;
        }
コード例 #29
0
        public ActionResult ActionCreate(TOURIS_TV_CATEGORY categoryView, HttpPostedFileBase postedFile)
        {
            try
            {
                string physicalPath = "";
                if (postedFile != null)
                {
                    string ImageName = System.IO.Path.GetFileName(postedFile.FileName); //file2 to store path and url
                    physicalPath = Server.MapPath("~" + Common.GetPathFolderImg() + ImageName);

                    categoryView.PHOTO_PATH = Common.GetPathFolderImg() + ImageName;
                }

                categoryView.CREATED_BY   = CurrentUser.GetCurrentUserId();
                categoryView.CREATED_TIME = CurrentUser.GetCurrentDateTime();

                rs = JsonConvert.DeserializeObject <ResultStatus>(ParsingObject.RequestData(categoryView, "Category", "Add", EnumList.IHttpMethod.Post.ToString()));
                if (rs.IsSuccess)
                {
                    if (physicalPath != "")
                    {
                        postedFile.SaveAs(physicalPath);
                    }

                    rs.SetSuccessStatus("Data has been created successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                }
                else
                {
                    rs.SetErrorStatus("Data failed to created");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to created");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
コード例 #30
0
        public ActionResult ActionLogin(CUSTOM_LOGIN login)
        {
            TOURIS_TV_USER userView = new TOURIS_TV_USER();
            TOURIS_TV_USER userRes  = new TOURIS_TV_USER();

            userRes = JsonConvert.DeserializeObject <TOURIS_TV_USER>(ParsingObject.RequestData(login, "User", "Login", EnumList.IHttpMethod.Post.ToString()));

            if (userRes.ID > 0)
            {
                Session["USER_ID_ID"]     = userRes.ID;
                Session["USER_ID"]        = userRes.USER_ID;
                Session["USER_EMAIL"]     = userRes.USER_MAIL;
                Session["IS_SUPER_ADMIN"] = userRes.IS_SUPER_ADMIN;
                Session["USER_NAME"]      = userRes.USER_NAME;
            }
            else
            {
                TempData["msgError"] = "Data incorrent";
                return(RedirectToAction("Login"));
            }
            return(RedirectToAction("Index", "Home"));
        }