public string getmessagebody() { StringBuilder MessageShow = new StringBuilder(); Int32 idformes = Convert.ToInt32(Request.QueryString["id".ToString()]); Goodssourceinformation detailForGoods = this.goodsinformationtable.Find(idformes); //开始组装html MessageShow.Append("<tr class=\"infoTitle\"><td><p id=\"infoTitle\" class=\"pInfoTitle\">"); MessageShow.Append(detailForGoods.Title); MessageShow.Append("</p><hr class=\"hr1\" /></td></tr><tr><td class=\"infoDetail\"><table><tbody><tr><td class=\"infoPic\"><div id=\"infoPic\"><img src=\"../../imgs/companys/4.jpg\" class=\"imgInfoPic\" /></div></td><td class=\"infoContacts\"><table><tbody><tr><td class=\"firstTd\">发布时间:</td><td class=\"secTd\"><span class=\"spanInfotime\">"); MessageShow.Append(detailForGoods.Releasedate); MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">联系人:</td><td class=\"secTd\"><span class=\"spanContactor\">"); Users userGoods = this.userInfos.Find(detailForGoods.Userid); MessageShow.Append(userGoods.Username); MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">联系电话:</td><td class=\"secTd\"><span class=\"spanContacts\">"); MessageShow.Append("***"); MessageShow.Append("</span></td></tr><tr><td><hr /></td><td><hr /></td></tr><tr><td class=\"firstTd\">启运地:</td><td class=\"secTd\"><span class=\"spanBeginAdr\">"); IList <County> goodsCounty = this.countyInfos.FindByCode(detailForGoods.Srccountycode); MessageShow.Append(goodsCounty[0].Name); MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">目的地:</td><td class=\"secTd\"><span class=\"spanEndAdr\">"); goodsCounty = this.countyInfos.FindByCode(detailForGoods.Dstcountycode); MessageShow.Append(goodsCounty[0].Name); MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">类型:</td><td class=\"secTd\"><span class=\"spanType\">"); Goodstype goodstypeInfos = this.goodsTypeInfo.Find(detailForGoods.Goodstypeid); MessageShow.Append(goodstypeInfos.Typename); MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">何时需要:</td><td class=\"secTd\"><span class=\"spanTimeToUse\">"); MessageShow.Append("***"); MessageShow.Append("</span></td></tr><tr><td><hr /></td><td><hr /></td></tr><tr><td class=\"firstTd\">特殊说明 :</td><td class=\"secTd\"><span class=\"spanPrice\">"); MessageShow.Append(detailForGoods.Content); MessageShow.Append("</span></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td></td></tr>"); return(MessageShow.ToString()); }
public int FindCountByTitlecolor(Goodssourceinformation obj) { String stmtId = "Goodssourceinformation.GetFindByTitlecolorCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public int FindCountByNeedtrunklength(Goodssourceinformation obj) { String stmtId = "Goodssourceinformation.GetFindByNeedtrunklengthCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public Goodssourceinformation Find(Int64 id) { String stmtId = "Goodssourceinformation.Find"; Goodssourceinformation result = this.sqlMapper.QueryForObject <Goodssourceinformation>(stmtId, id); return(result); }
public void Reload(Goodssourceinformation obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Goodssourceinformation.Find"; this.sqlMapper.QueryForObject <Goodssourceinformation>(stmtId, obj, obj); }
public void Delete(Goodssourceinformation obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Goodssourceinformation.Delete"; this.sqlMapper.Delete(stmtId, obj); }
public void ProcessRequest(HttpContext context) { if (context.Request.RequestType == "POST") { logger.Info("Request type is POST."); context.Response.ContentType = "text/plain"; StreamReader streamReader = new StreamReader(context.Request.InputStream); string userId = streamReader.ReadToEnd(); logger.Info("Got the request parameter UserID:" + userId); Goodssourceinformation goodsInfoPoco = new Goodssourceinformation(); long userIdLong = -1; bool result = long.TryParse(userId, out userIdLong); if (!result) { logger.Error("User ID is invalid."); context.Response.Write("-1"); } goodsInfoPoco.Userid = userIdLong; int itemCount = this.goodsInfoDao.FindCountByUserid(goodsInfoPoco); logger.Info("Got items data count:" + itemCount.ToString()); context.Response.Write(itemCount.ToString()); } 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); context.Response.ContentType = "text/plain"; 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.ContentType = "text/plain"; context.Response.Write(result); } } }
/// <summary> /// Delete GoodsSourceInformation item with ID /// </summary> /// <param name="id"></param> /// <returns></returns> private string deleteItem(string id) { logger.Info("Will delete the item with ID:" + id); Goodssourceinformation goodsInfoPoco = new Goodssourceinformation(); try { goodsInfoPoco.Id = long.Parse(id); this.goodsInfoDao.Delete(goodsInfoPoco); logger.Info("Delete succeeded."); return("删除成功"); } catch (Exception ex) { logger.Error("Delete item failed with exception:" + ex.Message); return("删除失败:" + ex.Message); } }
private Goodssourceinformation loadGoodsSourceInfoPoco() { Goodssourceinformation goodsSourceInfoPoco = new Goodssourceinformation(); goodsSourceInfoPoco.Active = 1; goodsSourceInfoPoco.Cautiontypeid = long.Parse(this.ddlCautionType.SelectedValue); goodsSourceInfoPoco.Content = this.txtGoodsInfo.Text; goodsSourceInfoPoco.Deadline = DateTime.Parse(this.txtValidTime.Text); goodsSourceInfoPoco.Dstcountycode = this.txtDstPlaceCode.Text; goodsSourceInfoPoco.Srccountycode = this.txtSrcPlaceCode.Text; goodsSourceInfoPoco.Title = this.txtTitle.Text; goodsSourceInfoPoco.Transporttypeid = long.Parse(this.ddlTransportType.SelectedValue); goodsSourceInfoPoco.Price = this.txtPrice.Text; goodsSourceInfoPoco.Goodsname = this.txtGoodsName.Text; goodsSourceInfoPoco.Goodstypeid = long.Parse(this.ddlGoodsType.SelectedValue); goodsSourceInfoPoco.Userid = long.Parse(base.UserId); goodsSourceInfoPoco.Releasedate = DateTime.Now; logger.Info("Goods source information loaded done."); return(goodsSourceInfoPoco); }
public void Update(Goodssourceinformation obj) { String stmtId = "Goodssourceinformation.Update"; this.sqlMapper.Update(stmtId, obj); }