示例#1
0
        public ActionResult LoadGroup(string lang)
        {
            var        grouplst = ServiceGroupManager.GetServiceGroupList(lang);
            JsonResult result   = Json(new SelectList(grouplst, "ServiceGroupId", "GroupName"));

            return(result);
        }
        public JsonResult EditStatus(int id)
        {
            string NowState;
            bool   isupdate = ServiceGroupManager.UpdateStatus(id);

            return(Json(isupdate));
        }
        public ActionResult EditServiceGroup()
        {
            var languages = LanguageManager.GetLanguages();
            var list      = new SelectList(languages, "Culture", "Language");

            ViewBag.LanguageList = list;
            if (RouteData.Values["id"] != null)
            {
                int  nid      = 0;
                bool isnumber = int.TryParse(RouteData.Values["id"].ToString(), out nid);
                if (isnumber)
                {
                    ServiceGroup editrecord = ServiceGroupManager.GetServiceGroupById(nid);
                    return(View(editrecord));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                return(View());
            }
            return(View());
        }
        //
        // GET: /Admin/ServiceGroup/

        public ActionResult Index()
        {
            string sellang = FillLanguagesList();

            var list = ServiceGroupManager.GetServiceGroupList(sellang);

            return(View(list));
        }
        public JsonResult Delete(int id)
        {
            bool isdelete = ServiceGroupManager.Delete(id);

            //if (isdelete)
            return(Json(isdelete));
            //  else return false;
        }
        public JsonResult SortRecords(string list)
        {
            JsonList psl = (new JavaScriptSerializer()).Deserialize <JsonList>(list);

            string[] idsList  = psl.list;
            bool     issorted = ServiceGroupManager.SortRecords(idsList);

            return(Json(issorted));
        }
示例#7
0
        string FillLanguagesList()
        {
            string lang = "";
            string id   = "";

            if (RouteData.Values["lang"] == null)
            {
                lang = "tr";
            }
            else
            {
                lang = RouteData.Values["lang"].ToString();
            }

            var languages = LanguageManager.GetLanguages();
            var list      = new SelectList(languages, "Culture", "Language", lang);

            ViewBag.LanguageList = list;

            var groups = ServiceGroupManager.GetServiceGroupList(lang);

            if (RouteData.Values["id"] == null)
            {
                if (groups != null && groups.Count != 0)
                {
                    id = groups.First().ServiceGroupId.ToString();
                }
                else
                {
                    id = "0";
                }
            }
            else
            {
                id = RouteData.Values["id"].ToString();
            }


            var grouplist = new SelectList(groups, "ServiceGroupId", "GroupName", id);

            ViewBag.GroupList = grouplist;

            return(id);
        }
        public ActionResult AddServiceGroup(ServiceGroup newmodel, HttpPostedFileBase uploadfile, HttpPostedFileBase uploadimage)
        {
            var languages = LanguageManager.GetLanguages();
            var list      = new SelectList(languages, "Culture", "Language");

            ViewBag.LanguageList = list;
            if (ModelState.IsValid)
            {
                newmodel.PageSlug      = Utility.SetPagePlug(newmodel.GroupName);
                newmodel.TimeCreated   = DateTime.Now;
                ViewBag.ProcessMessage = ServiceGroupManager.AddServiceGroup(newmodel);
                ModelState.Clear();

                return(View());
            }
            else
            {
                return(View());
            }
        }
        public ActionResult EditServiceGroup(ServiceGroup newmodel, HttpPostedFileBase uploadfile, HttpPostedFileBase uploadimage)
        {
            var languages = LanguageManager.GetLanguages();
            var list      = new SelectList(languages, "Culture", "Language");

            ViewBag.LanguageList = list;

            if (ModelState.IsValid)
            {
                newmodel.PageSlug = Utility.SetPagePlug(newmodel.GroupName);

                if (RouteData.Values["id"] != null)
                {
                    int  nid      = 0;
                    bool isnumber = int.TryParse(RouteData.Values["id"].ToString(), out nid);
                    if (isnumber)
                    {
                        newmodel.ServiceGroupId = nid;
                        ViewBag.ProcessMessage  = ServiceGroupManager.EditServiceGroup(newmodel);
                        return(View(newmodel));
                    }
                    else
                    {
                        ViewBag.ProcessMessage = false;
                        return(View(newmodel));
                    }
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                return(View());
            }
        }
示例#10
0
        public PartialViewResult topservices()
        {
            var services = ServiceGroupManager.GetServiceGroupListForFront(0, lang).Take(16);

            return(PartialView("_topservices", services));
        }