public ActionResult Save(ToolDownloadInfo toolDownloadInfo) { ToolDownloadBLL toolDownloadBLL = new ToolDownloadBLL(); bool b = toolDownloadBLL.SaveTool(toolDownloadInfo); return(Json(new { success = b }, JsonRequestBehavior.AllowGet)); }
public ToolDownloadList getToolDownloadList(ToolDownloadInfo toolDownloadInfo) { ToolDownloadList toolDownloadList = new ToolDownloadList(); DataTable dt = toolDownloadDAL.getToolList(toolDownloadInfo); toolDownloadList.rows = dt.toList <ToolDownloadInfo>(); toolDownloadList.total = toolDownloadDAL.getToolDownloadCount(toolDownloadInfo); return(toolDownloadList); }
public ActionResult SearchTool(ToolDownloadInfo toolDownloadInfo) { toolDownloadInfo.page = int.Parse(Request["page"]); toolDownloadInfo.rows = int.Parse(Request["rows"]); ToolDownloadList toolDownloadList = new ToolDownloadList(); ToolDownloadBLL toolDownloadBLL = new ToolDownloadBLL(); toolDownloadList = toolDownloadBLL.getToolDownloadList(toolDownloadInfo); return(Json(toolDownloadList, JsonRequestBehavior.AllowGet)); }
public int getToolDownloadCount(ToolDownloadInfo toolDownloadInfo) { StringBuilder sbSI = new StringBuilder(); sbSI.AppendFormat("select * from tooldownload Where 1=1 "); if (!string.IsNullOrEmpty(toolDownloadInfo.title)) { sbSI.AppendFormat("AND TITLE LIKE '%{0}%'", toolDownloadInfo.title); } DataTable dtBusiness = DBHelper.SearchSql(sbSI.ToString()); return(dtBusiness.Rows.Count); }
public bool SaveTool(ToolDownloadInfo toolDownloadInfo) { bool b = false; if (toolDownloadInfo.Id > 0) { b = toolDownloadDAL.UpdateTool(toolDownloadInfo); } else { b = toolDownloadDAL.Input(toolDownloadInfo); } return(b); }
public DataTable getToolList(ToolDownloadInfo toolDownloadInfo) { StringBuilder sbSI = new StringBuilder(); sbSI.AppendFormat("select * from tooldownload Where 1=1 "); if (!string.IsNullOrEmpty(toolDownloadInfo.title)) { sbSI.AppendFormat("AND TITLE LIKE '%{0}%'", toolDownloadInfo.title); } sbSI.Append(" ORDER BY CreateDate DESC"); sbSI.AppendFormat(" limit {0},{1};", (toolDownloadInfo.page - 1) * toolDownloadInfo.rows, toolDownloadInfo.rows); DataTable dtBusiness = DBHelper.SearchSql(sbSI.ToString()); return(dtBusiness); }
public bool UpdateTool(ToolDownloadInfo toolDownloadInfo) { StringBuilder sbAddUser = new StringBuilder(); string GetSessionWithDsmId = string.Format(@"update tooldownload set Title='{0}',url ='{1}', content ='{2}',picture='{3}',downloadNum ='{4}',CreateDate ='{5}' where id='{6}'", toolDownloadInfo.title, toolDownloadInfo.url, toolDownloadInfo.content, toolDownloadInfo.picture, toolDownloadInfo.downloadNum, toolDownloadInfo.CreateDate, toolDownloadInfo.Id); int iResult = DBHelper.ExcuteNoQuerySql(GetSessionWithDsmId); if (iResult == 1) { return(true); } else { return(false); } }
public bool Input(ToolDownloadInfo toolDownloadInfo) { StringBuilder sbAddUser = new StringBuilder(); string GetSessionWithDsmId = string.Format(@"INSERT INTO tooldownload (title,url,content,picture,downloadNum,CreateDate) VALUES('{0}','{1}','{2}','{3}','{4}','{5}')", toolDownloadInfo.title, toolDownloadInfo.url, toolDownloadInfo.content, toolDownloadInfo.picture, toolDownloadInfo.downloadNum, toolDownloadInfo.CreateDate); int iResult = DBHelper.ExcuteNoQuerySql(GetSessionWithDsmId); if (iResult == 1) { return(true); } else { return(false); } }