using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Model; using CY.BLL.OA; using CY.Infrastructure.Common; using CY.Infrastructure.Query; using CY.BLL.Sys; using CY.BLL; namespace CY.WebForm.Pages.procurement { //吴辉 //打印库存明细 public partial class InventoryPrint : BasePage { OA_InventoryBLL bll_OA_InventoryBLL = null; public InventoryPrint() { bll_OA_InventoryBLL = new OA_InventoryBLL(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindList(); } } protected void BindList() { Pagination pa = new Pagination(); pa.PageIndex = 1; pa.PageSize = int.MaxValue; string Keyid = Request["Keyid"].ToString2().Trim(','); List OA_InventoryList = bll_OA_InventoryBLL.SelectModelListByKeyid(CurrentUser.MemberId, Keyid).ToList(); List NEW_OA_InventoryList = new List(); foreach (var item in OA_InventoryList) { if (item.IsPaper == 1) { if (item.SpeceicationName.IndexOf("*") > 0) { int wNum = 0; int hNum = 0; try { wNum = item.SpeceicationName.Split('*')[0].ToInt32() ?? 0; hNum = item.SpeceicationName.Split('*')[1].ToInt32() ?? 0; } catch (Exception ex) { PAGEHandleException(ex); } try { //item.TotalPrice = (item.UnitPrice * item.InventoryCount); } catch (Exception ex) { PAGEHandleException(ex); } try { item.LingShu = item.InventoryCount.ToDouble2() / 500.ToDouble2(); item.DunShu = item.InventoryCount.ToDouble2() * (wNum.ToDouble2() * hNum.ToDouble2() / (1000 * 1000).ToDouble2()) * (item.PaperWeightName.ToInt32().ToDouble2() / (1000 * 1000).ToDouble2()); } catch (Exception ex) { PAGEHandleException(ex); } } } NEW_OA_InventoryList.Add(item); } RepFirmAccountIncomeList.DataSource = NEW_OA_InventoryList; RepFirmAccountIncomeList.DataBind(); this.NowPageAllMoney.InnerText = bll_OA_InventoryBLL.SelectModelListByKeyidTotalPrice(CurrentUser.MemberId, Keyid).ToString("0.00")+"元"; } } }