/// <summary> /// Gets the not all title. /// </summary> /// <param name="orderlist">The orderlist.</param> /// <returns></returns> /// 创建人:李允智 /// 创建时间:2015/9/21 /// 描述:不是全商品第二个就给一个等于 public static string GetNotAllTitle(string orderlist) { string[] orderarray = orderlist.Split(','); string allTitle = ""; bool enter = false; for (int i = 0; i < orderarray.Length; i += 2) { if (int.Parse(orderarray[i + 1]) == 0) { continue; } if (i >= 2) { enter = true; allTitle = allTitle.Substring(0, allTitle.Length - 1); allTitle += "等"; break; } else { allTitle += WebBLL.GetCherry(orderarray[i].ToString())[0].TITLE + "*" + orderarray[i + 1].ToString() + ","; } } if (enter) { return(allTitle); } else { return(allTitle.Substring(0, allTitle.Length - 1)); } }
/// <summary> /// Gets the small tile. /// </summary> /// <param name="orderlist">The orderlist.</param> /// <returns></returns> /// 创建人:李允智 /// 创建时间:2015/9/14 /// 描述:获取商品小消息 public static string GetAllTitle(string orderlist) { string[] orderarray = orderlist.Split(','); string allTitle = ""; for (int i = 0; i < orderarray.Length; i += 2) { if (int.Parse(orderarray[i + 1]) == 0) { continue; } allTitle += WebBLL.GetCherry(orderarray[i].ToString())[0].TITLE + "*" + orderarray[i + 1].ToString() + ","; } return(allTitle.Substring(0, allTitle.Length - 1)); }
public static void ImportExcel(string path) { HSSFWorkbook wb = new HSSFWorkbook(new FileStream(path, FileMode.Open)); HSSFSheet sht = wb.GetSheet("Sheet1"); //取行Excel的最大行数 int rowsCount = sht.PhysicalNumberOfRows; //为保证Table布局与Excel一样,这里应该取所有行中的最大列数(需要遍历整个Sheet)。 //为少一交全Excel遍历,提高性能,我们可以人为把第0行的列数调整至所有行中的最大列数。 int colsCount = sht.GetRow(0).PhysicalNumberOfCells; StringBuilder table = new StringBuilder(rowsCount * 32); for (int rowIndex = 1; rowIndex < rowsCount; rowIndex++) { Guid id = new Guid(sht.GetRow(rowIndex).GetCell(0).StringCellValue); string logistics = sht.GetRow(rowIndex).GetCell(8).ToString(); WebBLL.UpdateLogistics(id, logistics); } }
/// <summary> /// Updates the poll. /// </summary> /// <param name="id">The identifier.</param> /// <param name="title">The title.</param> /// <param name="color">The color.</param> /// <param name="price">The price.</param> /// <param name="memberprice">The memberprice.</param> /// <param name="imgpath">The imgpath.</param> /// <param name="smalltitle">The smalltitle.</param> /// <param name="code">The code.</param> /// <param name="des">The DES.</param> /// <returns></returns> /// 创建人:李允智 /// 创建时间:2015/9/14 /// 描述:更新投票数 public static bool UpdatePoll(Guid ID) { using (Model.BestCherryEntities entitys = new Model.BestCherryEntities()) { try { List <Model.BestCherryInfo> list = WebBLL.GetCherry(ID); if (list.Count != 0) { BestCherryInfo bci = list[0]; int poll = 0; if (list[0].POLL != null) { poll = (int)list[0].POLL; } bci.POLL = poll + 1; //将实体对象加入EF对象容器中,并获取伪包装类对象 DbEntityEntry <BestCherryInfo> entry = entitys.Entry <BestCherryInfo>(bci); //将包装类对象 的状态设置为 Unchanged entry.State = System.Data.Entity.EntityState.Modified; entry.Property(a => a.POLL).IsModified = true; entitys.SaveChanges(); return(true); } else { return(false); } } catch (DbEntityValidationException dbEx) { return(false); throw; } } }