public int FindCountByRoutetypeid(Trunkinformation obj)
        {
            String stmtId = "Trunkinformation.GetFindByRoutetypeidCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
        public int FindCountByNegotiateprice(Trunkinformation obj)
        {
            String stmtId = "Trunkinformation.GetFindByNegotiatepriceCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
        public Trunkinformation Find(Int64 id)
        {
            String           stmtId = "Trunkinformation.Find";
            Trunkinformation result = this.sqlMapper.QueryForObject <Trunkinformation>(stmtId, id);

            return(result);
        }
        public void Reload(Trunkinformation obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Trunkinformation.Find";

            this.sqlMapper.QueryForObject <Trunkinformation>(stmtId, obj, obj);
        }
        public void Delete(Trunkinformation obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Trunkinformation.Delete";

            this.sqlMapper.Delete(stmtId, obj);
        }
Exemple #6
0
 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();
         Trunkinformation trunkInfoPoco = new Trunkinformation();
         long             userIdLong    = 0;
         bool             parseResult   = long.TryParse(userId, out userIdLong);
         if (parseResult)
         {
             trunkInfoPoco.Userid = userIdLong;
             int itemsCount = this.trunkInfoDao.FindCountByUserid(trunkInfoPoco);
             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);
         }
     }
 }
        public string GetMessageBody()
        {
            StringBuilder    MessageShow    = new StringBuilder();
            Int32            idformes       = Convert.ToInt32(Request.QueryString["id".ToString()]);
            Trunkinformation detailForTrunk = this.trunkinfos.Find(idformes);

            //开始组装html

            MessageShow.Append("<tr><td class=\"right-leftSide\"><table><tbody><tr class=\"infoTitle\"><td><p id=\"infoTitle\" class=\"pInfoTitle\">");
            MessageShow.Append(detailForTrunk.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(detailForTrunk.Releasedate);
            MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">联系人:</td><td class=\"secTd\"><span class=\"spanContactor\">");
            Trunkmetadata trunkownerDetails = this.trunkMeta.Find(detailForTrunk.Trunkid);

            MessageShow.Append(trunkownerDetails.Contactpersonname);
            MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">联系电话:</td><td class=\"secTd\"><span class=\"spanContacts\">");
            MessageShow.Append(trunkownerDetails.Conatactphone);
            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> countyinfos = this.countyTable.FindByCode(detailForTrunk.Srccountycode);

            MessageShow.Append(countyinfos[0].Name);
            MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">目的地:</td><td class=\"secTd\"><span class=\"spanEndAdr\">");
            countyinfos = this.countyTable.FindByCode(detailForTrunk.Dstcountycode);
            MessageShow.Append(countyinfos[0].Name);
            MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">类型:</td><td class=\"secTd\"><span class=\"spanType\">");

            Trunktype trunktypes = this.trunkTypeinfo.Find(trunkownerDetails.Trunktypeid);

            MessageShow.Append(trunktypes.Typename);
            MessageShow.Append("</span></td></tr><tr><td class=\"firstTd\">何时需要:</td><td class=\"secTd\"><span class=\"spanTimeToUse\">");
            if (detailForTrunk.Timetypeid == 0)
            {
                MessageShow.Append("即时车源");
            }
            else
            {
                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(detailForTrunk.Description);
            MessageShow.Append("</span></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td></td></tr></tbody></table></td><td class=\"right-rightSide\"><div class=\"deliverInfoNum\">已发布信息:<span class=\"spanLorryInfoNum\">");
            MessageShow.Append("待获取数据");
            MessageShow.Append("</span>条</div><div></div></td></tr>");

            return(MessageShow.ToString());
        }
Exemple #8
0
        private string deleteItem(string id)
        {
            logger.Info("Will remove trunk information item with id:" + id);
            Trunkinformation trunkInfoPoco = new Trunkinformation();

            try
            {
                trunkInfoPoco.Id = long.Parse(id);
                this.trunkInfoDao.Delete(trunkInfoPoco);
                logger.Info("Deleted done, item id:" + id);
                return("删除成功");
            }
            catch (Exception ex)
            {
                logger.Error("Delete failed with exception:" + ex.Message);
                return("删除失败:" + ex.Message);
            }
        }
        private Trunkinformation loadEntity()
        {
            Trunkinformation trunkInformationEntity = new Trunkinformation();

            trunkInformationEntity.Active         = 1;
            trunkInformationEntity.Description    = this.txtDescription.Text;
            trunkInformationEntity.Dstcountycode  = this.txtDstPlaceCode.Text;
            trunkInformationEntity.Marketprice    = this.txtPrice.Text;
            trunkInformationEntity.Negotiateprice = this.txtNegotiatePrice.Text;
            trunkInformationEntity.Releasedate    = DateTime.Now;
            trunkInformationEntity.Returntypeid   = long.Parse(this.ddlReturnType.SelectedValue);
            trunkInformationEntity.Router         = this.txtRouter.Text;
            trunkInformationEntity.Routetypeid    = long.Parse(this.ddlRouteType.SelectedValue);
            trunkInformationEntity.Srccountycode  = this.txtSrcPlaceCode.Text;
            trunkInformationEntity.Takeofftime    = DateTime.Parse(this.txtTakeOffTime.Text);
            trunkInformationEntity.Timetypeid     = long.Parse(this.ddlTimeType.SelectedValue);
            trunkInformationEntity.Title          = this.txtTitle.Text;
            trunkInformationEntity.Trunkid        = long.Parse(this.ddlTrunk.SelectedValue);
            trunkInformationEntity.Userid         = long.Parse(base.UserId);
            logger.Info("Information wrapped done.");
            return(trunkInformationEntity);
        }
        public void Update(Trunkinformation obj)
        {
            String stmtId = "Trunkinformation.Update";

            this.sqlMapper.Update(stmtId, obj);
        }