/// <summary> /// 分页集合按主单分页 /// </summary> /// <param name="param"></param> /// <returns></returns> public PageList <STK_StockTtlResult> GetPageList(STK_StockTtlParam param) { this.CheckSession(); PageList <STK_StockTtlResult> ret = new PageList <STK_StockTtlResult>(); try { List <Field> field = new List <Field>() { Field.All }; ret = this.SelectList <STK_StockTtlResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), field, GetWhereClip(param), STK_StockTtl._.CreatedTime.Desc); //foreach (STK_StockTtlResult stockTtl in ret.ResultList) //{ // List<STK_StockResult> stockList = this.SelectList<STK_StockResult>(STK_Stock._.TItemCode == stockTtl.TItemCode && STK_Stock._.InvQty != 0, STK_Stock._.CreatedTime.Desc); // if (stockList != null && stockList.Count>0) // { // stockTtl.StockList = stockList; // } //} } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
/// <summary> /// 删除实体 /// </summary> /// <param name="param">删除条件实体</param> /// <returns></returns> public WCFAddUpdateResult DelInfo(STK_StockTtlParam param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); int affect = 0; try { #region 判断 if (param.TItemCode == null) { throw new WarnException("请指定GUID!"); } #endregion WhereClip whereClip = GetWhereClip(param); STK_StockTtlResult info = new STK_StockTtlResult(); info.IsDeleted = true; affect = this.Update <STK_StockTtlResult>(info, whereClip); #region 设置返回值 ret.Key = affect; #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
/// <summary> /// 分页集合按明细分页 /// </summary> /// <param name="param"></param> /// <returns></returns> public PageList <STK_StockTtlResult> GetPageListByDetail(STK_StockTtlParam param) { this.CheckSession(); PageList <STK_StockTtlResult> stockTtlPgList = new PageList <STK_StockTtlResult>(); PageList <STK_StockResult> stockPgList = new PageList <STK_StockResult>(); try { List <Field> field = new List <Field>() { Field.All }; WhereClip clip = STK_Stock._.IsDeleted == 0 && STK_Stock._.InvQty != 0; if (!string.IsNullOrEmpty(param.Model)) { clip = clip && STK_Stock._.Model.Like(param.Model + "%"); } if (!string.IsNullOrEmpty(param.Brand)) { clip = clip && STK_Stock._.Brand.Like(param.Brand + "%"); } if (!string.IsNullOrEmpty(param.Batch)) { clip = clip && STK_Stock._.Brand.Like(param.Batch + "%"); } if (!string.IsNullOrEmpty(param.Package)) { clip = clip && STK_Stock._.Brand.Like(param.Package + "%"); } stockPgList = this.SelectList <STK_StockResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), field, clip, STK_Stock._.CreatedTime.Desc); List <STK_StockResult> stockList = stockPgList.ResultList; if (stockList != null && stockList.Count > 0) { stockTtlPgList.TotalCount = stockPgList.TotalCount; Guid?[] tItemCodes = stockList.Select(a => a.TItemCode).Distinct().ToArray(); List <STK_StockTtlResult> stockTtlList = this.SelectList <STK_StockTtlResult>(STK_StockTtl._.TItemCode.In(tItemCodes)); foreach (STK_StockTtlResult stockTtl in stockTtlList) { List <STK_StockResult> list = stockList.Where(a => a.TItemCode == stockTtl.TItemCode).ToList(); if (list != null && list.Count > 0) { stockTtl.StockList = list; } } stockTtlPgList.ResultList = stockTtlList; } } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(stockTtlPgList); }
public WCFAddUpdateResult DelInfo(STK_StockTtlParam param) { WCFAddUpdateResult ret = new WCFAddUpdateResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.STK.STK_StockTtlBLL", "DelInfo", param); ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult); return(ret); }
public STK_StockTtlResult GetInfo(STK_StockTtlParam param) { STK_StockTtlResult ret = new STK_StockTtlResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.STK.STK_StockTtlBLL", "GetInfo", param); ret = (rst == null ? new STK_StockTtlResult() : rst.Result as STK_StockTtlResult); return(ret); }
public List <STK_StockTtlResult> GetList(STK_StockTtlParam param) { ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.STK.STK_StockTtlBLL", "GetList", param); List <STK_StockTtlResult> list = new List <STK_StockTtlResult>(); list = (rst == null ? new List <STK_StockTtlResult>() : rst.Result as List <STK_StockTtlResult>); return(list); }
public PageList <STK_StockTtlResult> GetPageList(STK_StockTtlParam param) { ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.STK.STK_StockTtlBLL", "GetPageList", param); PageList <STK_StockTtlResult> pageList = new PageList <STK_StockTtlResult>(); pageList = (rst == null ? new PageList <STK_StockTtlResult>() : rst.Result as PageList <STK_StockTtlResult>); return(pageList); }
WhereClip GetWhereClip(STK_StockTtlParam param) { this.CheckSession(); WhereClip where = STK_StockTtl._.IsDeleted == 0; if (param.TItemCode != null) { where = where && STK_StockTtl._.TItemCode == param.TItemCode; } if (!string.IsNullOrEmpty(param.Model)) { where = where && STK_StockTtl._.Model.Like("%" + param.Model + "%"); } return(where); }
/// <summary> /// 获取一条信息记录 /// </summary> /// <param name="param"></param> /// <returns></returns> public STK_StockTtlResult GetInfo(STK_StockTtlParam param) { this.CheckSession(); STK_StockTtlResult rst = new STK_StockTtlResult(); #region 判断 if (param.TItemCode == null) { throw new WarnException("请指定GUID!"); } #endregion #region 获取实体 rst = this.Select <STK_StockTtlResult>(GetWhereClip(param)); #endregion return(rst); }
/// <summary> /// 获取集合 /// </summary> /// <param name="param"></param> /// <returns></returns> public List <STK_StockTtlResult> GetList(STK_StockTtlParam param) { this.CheckSession(); List <STK_StockTtlResult> ret = new List <STK_StockTtlResult>(); try { WhereClip whereClip = GetWhereClip(param); ret = this.SelectList <STK_StockTtlResult>(whereClip, STK_StockTtl._.CreatedTime.Asc); } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
private void BindSuperGrid(int pageIndex) { STK_StockTtlParam param = new STK_StockTtlParam(); param.Model = txtModel.Text; param.PageIndex = pageIndex; param.PageSize = 100; GridPanel panel = sgcStock.PrimaryGrid; PageList <STK_StockTtlResult> pageList = this.AsyncExecute <PageList <STK_StockTtlResult>, STK_StockTtlParam>(param, stockTtlLogic.GetPageListByDetail, a => { // panel.DataSource = a.ResultList; pgStock.RecordCount = a.TotalCount; //sgcStock.BeginUpdate(); //foreach (STK_StockTtlResult stockTtl in a.ResultList) //{ // GridRow row = panel.NewRow(); // row.Cells["colSelect"].ReadOnly = true; // row.Cells["colTItemCode"].Value = stockTtl.TItemCode; // row.Cells["colModel"].Value = stockTtl.Model; // row.Cells["colBrand"].Value = stockTtl.Brand; // row.Cells["colBatch"].Value = stockTtl.Batch; // panel.Rows.Add(row); // foreach (STK_StockResult stock in stockTtl.StockList) // { // GridPanel childPanel = new GridPanel(); // childPanel.Columns.Add(new GridColumn("colModel")); // childPanel.Columns.Add(new GridColumn("colQty")); // childPanel.Rows.Add(new GridRow(new object[] { "11", "22" })); // row.Rows.Add(childPanel); // } //} //sgcStock.EndUpdate(); sgcStock.BeginUpdate(); panel.Rows.Clear(); foreach (STK_StockTtlResult stockTtl in a.ResultList) { GridRow row = panel.NewRow(); //new Background(Color.AliceBlue) //new Background(Color.White, Color.FromArgb(238, 244, 251), 45); // new Background(Color.FromArgb(249, 249, 234)); // new Background(Color.FromArgb(255, 247, 250)); row.CellStyles.Default.Background = new Background(Color.FromArgb(238, 244, 251)); row.Cells["colSelect"].ReadOnly = true; row.Cells["colTItemCode"].Value = stockTtl.TItemCode; row.Cells["colModel"].Value = stockTtl.Model; row.Cells["colBrand"].Value = stockTtl.Brand; row.Cells["colBatch"].Value = stockTtl.Batch; row.Cells["colPackage"].Value = stockTtl.Package; row.Cells["colWarehouse"].Value = stockTtl.Warehouse; row.Cells["colInvQty"].Value = stockTtl.TotalQty; row.Cells["colBookedQty"].Value = stockTtl.MaxQty; row.Cells["colUsableQty"].Value = stockTtl.MinQty; row.Cells["colFollowPrice"].Value = stockTtl.MinQty; row.Cells["colSalePrice"].Value = stockTtl.MinQty; row.Cells["colCreatedTime"].Value = stockTtl.CreatedTime; panel.Rows.Add(row); foreach (STK_StockResult stock in stockTtl.StockList) { GridRow childRow = panel.NewRow(); childRow.Cells["colItemCode"].Value = stock.ItemCode; childRow.Cells["colTItemCode"].Value = stock.TItemCode; childRow.Cells["colModel"].Value = stock.Model; childRow.Cells["colBrand"].Value = stock.Brand; childRow.Cells["colBatch"].Value = stock.Batch; childRow.Cells["colPackage"].Value = stock.Package; childRow.Cells["colWarehouse"].Value = stock.Warehouse; childRow.Cells["colInvQty"].Value = stock.InvQty; childRow.Cells["colBookedQty"].Value = stock.BookedQty; childRow.Cells["colUsableQty"].Value = stock.UsableQty; childRow.Cells["colFollowPrice"].Value = stock.FollowPrice; childRow.Cells["colSalePrice"].Value = stock.SalePrice; childRow.Cells["colInBatchNo"].Value = stock.InBatchNo; childRow.Cells["colLocation"].Value = stock.Location; childRow.Cells["colQuality"].Value = stock.Quality; childRow.Cells["colMPQ"].Value = stock.MPQ; childRow.Cells["colMarkCode"].Value = stock.MarkCode; childRow.Cells["colDescription"].Value = stock.Description; childRow.Cells["colRemark"].Value = stock.Remark; childRow.Cells["colInvType"].Value = stock.InvType; childRow.Cells["colUnit"].Value = stock.Unit; childRow.Cells["colCurrency"].Value = stock.Currency; childRow.Cells["colBuyPrice"].Value = stock.BuyPrice; childRow.Cells["colBuyPriceRMB"].Value = stock.BuyPriceRMB; childRow.Cells["colBuyAveragePrice"].Value = stock.BuyAveragePrice; childRow.Cells["colCreatedTime"].Value = stock.CreatedTime; row.Rows.Add(childRow); } } sgcStock.EndUpdate(); panel.ExpandAll(); }); }