Beispiel #1
0
        //
        // GET: /PortalBlock/ShortCut/

        public JsonResult Add()
        {
            S_H_ShortCut model = UpdateEntity <S_H_ShortCut>(string.Empty);

            entities.Set <S_H_ShortCut>().Add(model);
            entities.SaveChanges();
            return(Json(string.Empty));
        }
Beispiel #2
0
 public JsonResult SortShortCut(string pageIndex, string ids)
 {
     if (!string.IsNullOrEmpty(ids))
     {
         string[]            arr  = ids.Split(',');
         List <S_H_ShortCut> list = entities.Set <S_H_ShortCut>().Where(c => arr.Contains(c.ID)).ToList();
         for (int i = 0; i < arr.Length; i++)
         {
             string       id    = arr[i];
             S_H_ShortCut model = list.Find(c => c.ID == id);
             if (model != null)
             {
                 model.PageIndex = Convert.ToInt32(pageIndex);
                 model.SortIndex = i;
             }
         }
         entities.SaveChanges();
     }
     return(Json(string.Empty));
 }