public ActionResult GetFormJson(string keyValue)
        {
            var        data  = gallerydetailbll.GetEntity(keyValue);
            Tk_Gallery tktmp = gallerybll.GetEntity(data.GalleryId);
            string     tmp   = tktmp.GalleryName;

            return(ToJsonResult(new { data = data, GalleryName = tmp }));
        }
Beispiel #2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, Tk_Gallery entity)
 {
     try
     {
         //entity.CategoryId=
         DataItemEntity dataItemEntit = QueryDataItemEntityByItemName(entity.AreaCode);
         if (dataItemEntit != null)
         {
             entity.CategoryId = dataItemEntit.ItemId;
         }
         service.SaveForm(keyValue, entity);
     }
     catch (Exception ee)
     {
         throw;
     }
 }
Beispiel #3
0
        public List <Tk_GalleryDetail> GetPageList(Pagination pagination, string queryJson)
        {
            try
            {
                if (!String.IsNullOrEmpty(queryJson))
                {
                    Dictionary <string, string> dict = new Dictionary <string, string>();
                    dict = JsonConvert.DeserializeObject <Dictionary <string, string> >(queryJson);
                    List <Tk_Gallery> glist = new List <Tk_Gallery>();
                    if (dict.Keys.Contains("GalleryName"))
                    {
                        string            gname = dict["GalleryName"];
                        List <Tk_Gallery> tlist = tk_GalleryBLL.GetList(w => w.GalleryName == gname).ToList();
                        if (tlist.Count > 0)
                        {
                            dict["GalleryId"] = tlist[0].ID;
                            queryJson         = JsonConvert.SerializeObject(dict);
                        }
                    }
                }

                List <Tk_GalleryDetail> list          = service.GetPageList(pagination, queryJson).ToList();
                List <string>           GalleryIdlist = list.Select(s => s.GalleryId).ToList();
                List <Tk_Gallery>       gallerylist   = tk_GalleryBLL.GetList(w => GalleryIdlist.Contains(w.ID)).ToList();
                for (int i = 0; i < list.Count; i++)
                {
                    Tk_Gallery tmp = gallerylist.SingleOrDefault(w => w.ID == list[i].GalleryId);
                    if (tmp != null)
                    {
                        list[i].GalleryId = tmp.GalleryName;
                    }
                    else
                    {
                        list[i].GalleryId = "";
                    }
                }
                return(list);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #4
0
 public ActionResult SaveForm(string keyValue, Tk_Gallery entity)
 {
     // entity.ID = Guid.NewGuid().ToString().Replace("-", "");
     gallerybll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }
 public ActionResult SaveForm(string keyValue, Tk_Gallery entity)
 {
     tk_gallerybll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }