public int FindCountByCountycode(Depotinformation obj) { String stmtId = "Depotinformation.GetFindByCountycodeCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public Depotinformation Find(Int64 id) { String stmtId = "Depotinformation.Find"; Depotinformation result = this.sqlMapper.QueryForObject <Depotinformation>(stmtId, id); return(result); }
public void Reload(Depotinformation obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Depotinformation.Find"; this.sqlMapper.QueryForObject <Depotinformation>(stmtId, obj, obj); }
public void Delete(Depotinformation obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "Depotinformation.Delete"; this.sqlMapper.Delete(stmtId, obj); }
/// <summary> /// Delete item of depotory information. /// </summary> /// <param name="id">id of depotory information</param> /// <returns>result of delete.</returns> private string deleteItem(string id) { logger.Info("Will remove depot information item with id:" + id); Depotinformation depotInfoPoco = new Depotinformation(); depotInfoPoco.Id = long.Parse(id); try { this.depotoryDao.Delete(depotInfoPoco); logger.Info("Deleted done, item id:" + id); return("删除成功"); } catch (Exception ex) { logger.Error("Delete failed with exception:" + ex.Message); return("删除失败:" + ex.Message); } }
public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") {// Items count logger.Info("Request type is POST."); StreamReader streamReader = new StreamReader(context.Request.InputStream); string parameter = streamReader.ReadToEnd(); logger.Info("Got the parameter:" + parameter); context.Response.ContentType = "text/plain"; Depotinformation depotInfoPoco = new Depotinformation(); depotInfoPoco.Userid = long.Parse(parameter); int itemsCount = this.depotoryDao.FindCountByUserid(depotInfoPoco); logger.Info("Got items count:" + itemsCount.ToString() + " from User:"******"Request type is GET."); foreach (string parameterName in context.Request.QueryString.AllKeys) { logger.Info("Request parameter:" + parameterName + ", with value:" + context.Request.QueryString[parameterName].ToString()); } if (context.Request.QueryString.Count == 4) {// Pagination data retrieve 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); } } }
private Depotinformation loadEntity() { Depotinformation depotInfoEntity = new Depotinformation(); depotInfoEntity.Address = this.txtAddress.Text; depotInfoEntity.Area = int.Parse(this.txtArea.Text); depotInfoEntity.Bizscopetype = long.Parse(this.ddlBizScope.SelectedValue); depotInfoEntity.Cellphone = this.txtPhone.Text; depotInfoEntity.Contactperson = this.txtContactPerson.Text; depotInfoEntity.Depottype = long.Parse(this.ddlDepotType.SelectedValue); depotInfoEntity.Description = this.txtNote.Text; depotInfoEntity.Price = this.txtPrice.Text; depotInfoEntity.Title = this.txtTitle.Text; depotInfoEntity.Useablearea = int.Parse(this.txtUseableArea.Text); depotInfoEntity.Validtime = this.txtValidTime.Text; depotInfoEntity.Userid = long.Parse(base.UserId); depotInfoEntity.Countycode = this.txtSrcPlaceCode.Text; logger.Info("Information loaded done."); return(depotInfoEntity); }
public void Update(Depotinformation obj) { String stmtId = "Depotinformation.Update"; this.sqlMapper.Update(stmtId, obj); }