public ActionResult ActivityEdit(ActivityBuild model)
        {
            if (model.id == 0)
            {
                if (!string.IsNullOrEmpty(model.Content))
                {
                    bool result = ActivityManager.InsertActivityBuild(model);
                    return(Json(result));
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(model.Content))
                {
                    string activityMenu = JsonConvert.SerializeObject(ActivityMenuBll.GetList(model.id.ToString()));
                    string activityHome = JsonConvert.SerializeObject(ActivityHomeBll.GetList(model.id.ToString()));
                    model.ActivityHome = activityHome;
                    model.ActivityMenu = activityMenu;

                    bool result = ActivityManager.UpdateActivityBuild(model, model.id);

                    return(Json(result));
                }
            }
            return(Json(false));
        }
Exemplo n.º 2
0
        //
        // GET: /ActivityHome/

        public ActionResult Index(string activityID)
        {
            if (activityID != "0")
            {
                IEnumerable <ActivityHome> list = ActivityHomeBll.GetList(activityID).Rows.Cast <DataRow>().Select(row => new ActivityHome(row));
                if (list.Count() > 0)
                {
                    return(View(list));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                return(View());
            }
        }