コード例 #1
0
        public int FindCountByReleasedate(Speciallineinfo obj)
        {
            String stmtId = "Speciallineinfo.GetFindByReleasedateCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
コード例 #2
0
        public int FindCountBySourceplaceinfoid(Speciallineinfo obj)
        {
            String stmtId = "Speciallineinfo.GetFindBySourceplaceinfoidCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
コード例 #3
0
        public Speciallineinfo Find(Int64 id)
        {
            String          stmtId = "Speciallineinfo.Find";
            Speciallineinfo result = this.sqlMapper.QueryForObject <Speciallineinfo>(stmtId, id);

            return(result);
        }
コード例 #4
0
        public void Reload(Speciallineinfo obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Speciallineinfo.Find";

            this.sqlMapper.QueryForObject <Speciallineinfo>(stmtId, obj, obj);
        }
コード例 #5
0
        public void Delete(Speciallineinfo obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Speciallineinfo.Delete";

            this.sqlMapper.Delete(stmtId, obj);
        }
コード例 #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();
         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);
         }
     }
 }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        public void Update(Speciallineinfo obj)
        {
            String stmtId = "Speciallineinfo.Update";

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