public ActionResult Save(FootLinkViewModel mode) { FootLinkBLL bll = new FootLinkBLL(); bool b = bll.SaveFootLink(mode); return(Json(new { success = b }, JsonRequestBehavior.AllowGet)); }
public ActionResult SearchFootLink(FootLinkViewModel model) { model.page = int.Parse(Request["page"]); model.rows = int.Parse(Request["rows"]); FootLinkBLL footbll = new FootLinkBLL(); FootLinkList list = footbll.getList(model); return(Json(list, JsonRequestBehavior.AllowGet)); }
public FootLinkList getList(FootLinkViewModel model) { FootLinkList footLinkList = new FootLinkList(); DataTable dt = footLinkDAL.getList(model); footLinkList.rows = dt.toList <FootLinkModel>(); footLinkList.total = footLinkDAL.getCount(model); return(footLinkList); }
public bool SaveFootLink(FootLinkViewModel mode) { bool b = false; if (mode.Id > 0) { b = footLinkDAL.UpdateFootLink(mode); } else { b = footLinkDAL.InsertFootLink(mode); } return(b); }
public bool UpdateFootLink(FootLinkViewModel mode) { StringBuilder sbAddUser = new StringBuilder(); string GetSessionWithDsmId = string.Format(@"update FootLink set ImageURL='{0}',SiteURL ='{1}',CreateDate ='{2}', Name ='{3}' where Id ='{4}' ", mode.ImageURL, mode.SiteURL, mode.CreateDate, mode.Name, mode.Id); int iResult = DBHelper.ExcuteNoQuerySql(GetSessionWithDsmId); if (iResult == 1) { return(true); } else { return(false); } }
public bool InsertFootLink(FootLinkViewModel mode) { StringBuilder sbAddUser = new StringBuilder(); string GetSessionWithDsmId = string.Format(@"INSERT INTO FootLink (ImageURL,SiteURL,Name,CreateDate) VALUES('{0}','{1}','{2}','{3}')", mode.ImageURL, mode.SiteURL, mode.Name, mode.CreateDate); int iResult = DBHelper.ExcuteNoQuerySql(GetSessionWithDsmId); if (iResult == 1) { return(true); } else { return(false); } }