public int FindCountByReleasedate(Speciallineinfo obj) { String stmtId = "Speciallineinfo.GetFindByReleasedateCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public int FindCountBySourceplaceinfoid(Speciallineinfo obj) { String stmtId = "Speciallineinfo.GetFindBySourceplaceinfoidCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public Speciallineinfo Find(Int64 id) { String stmtId = "Speciallineinfo.Find"; Speciallineinfo result = this.sqlMapper.QueryForObject <Speciallineinfo>(stmtId, id); return(result); }
public void Reload(Speciallineinfo obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Speciallineinfo.Find"; this.sqlMapper.QueryForObject <Speciallineinfo>(stmtId, obj, obj); }
public void Delete(Speciallineinfo obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Speciallineinfo.Delete"; this.sqlMapper.Delete(stmtId, obj); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (context.Request.RequestType == "POST") { logger.Info("Request type is POST."); StreamReader streamReader = new StreamReader(context.Request.InputStream); string userId = streamReader.ReadToEnd(); Speciallineinfo lineInfoPoco = new Speciallineinfo(); long userIdLong = 0; bool parseResult = long.TryParse(userId, out userIdLong); if (parseResult) { lineInfoPoco.Userid = userIdLong; int itemsCount = this.speciallineDao.FindCountByUserid(lineInfoPoco); logger.Info("Items count:" + itemsCount.ToString()); context.Response.Write(itemsCount.ToString()); } else { logger.Info("User ID parse failed:" + userId); context.Response.Write("0"); } } else { logger.Info("Request type is GET."); foreach (string paramName in context.Request.QueryString.AllKeys) { logger.Info("Parameter name" + paramName + ", with value:" + context.Request.QueryString[paramName].ToString()); } if (context.Request.QueryString.Count == 4) { logger.Info("Pagination query."); string pageNumber = context.Request.QueryString["pageNumber"].ToString(); string pageSize = context.Request.QueryString["pageSize"].ToString(); string userId = context.Request.QueryString["userid"].ToString(); string htmlData = this.buildTableHTML(pageNumber, pageSize, userId); logger.Info("Table HTML builded done:" + htmlData); context.Response.Write(htmlData); } else { // Delete item logger.Info("delete item"); string id = context.Request.QueryString["id"].ToString(); string result = this.deleteItem(id); context.Response.Write(result); } } }
private string deleteItem(string id) { Speciallineinfo lineInfoPoco = new Speciallineinfo(); try { lineInfoPoco.Id = long.Parse(id); this.speciallineDao.Delete(lineInfoPoco); logger.Info("Item removed done."); return("删除成功"); } catch (Exception ex) { logger.Error("Remove item failed with exception:" + ex.Message); return("删除失败:" + ex.Message); } }
public void Update(Speciallineinfo obj) { String stmtId = "Speciallineinfo.Update"; this.sqlMapper.Update(stmtId, obj); }