Example #1
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(STK_StockParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.ItemCode == null)
                {
                    throw new WarnException("请指定GUID!");
                }
                #endregion
                WhereClip       whereClip = GetWhereClip(param);
                STK_StockResult info      = new STK_StockResult();
                info.IsDeleted = true;
                affect         = this.Update <STK_StockResult>(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);
        }
Example #2
0
 WhereClip GetWhereClip(STK_StockParam param)
 {
     this.CheckSession();
     WhereClip where = STK_Stock._.IsDeleted == 0;
     if (param.ItemCode != null)
     {
         where = where && STK_Stock._.ItemCode == param.ItemCode;
     }
     if (param.ItemCodes != null && param.ItemCodes.Length > 0)
     {
         where = where && STK_Stock._.ItemCode.In(param.ItemCodes);
     }
     if (param.NoItemCodes != null && param.ItemCodes.Length > 0)
     {
         where = where && !STK_Stock._.ItemCode.In(param.NoItemCodes);
     }
     if (!string.IsNullOrEmpty(param.Model))
     {
         where = where && STK_Stock._.Model.Like("%" + param.Model + "%");
     }
     if (param.AllowUsableQtyZero != null && !param.AllowUsableQtyZero.ToBooleanHasNull())
     {
         where = where && STK_Stock._.UsableQty != 0;
     }
     return(where);
 }
Example #3
0
        public WCFAddUpdateResult DelInfo(STK_StockParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_StockBLL", "DelInfo", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Example #4
0
        public STK_StockResult GetInfo(STK_StockParam param)
        {
            STK_StockResult ret = new STK_StockResult();
            ExeResult       rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_StockBLL", "GetInfo", param);
            ret = (rst == null ? new STK_StockResult() : rst.Result as STK_StockResult);
            return(ret);
        }
Example #5
0
        public List <STK_StockResult> GetList(STK_StockParam param)
        {
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_StockBLL", "GetList", param);
            List <STK_StockResult> list = new List <STK_StockResult>();

            list = (rst == null ? new List <STK_StockResult>() : rst.Result as List <STK_StockResult>);
            return(list);
        }
Example #6
0
        public PageList <STK_StockResult> GetPageList(STK_StockParam param)
        {
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_StockBLL", "GetPageList", param);
            PageList <STK_StockResult> pageList = new PageList <STK_StockResult>();

            pageList = (rst == null ? new PageList <STK_StockResult>() : rst.Result as PageList <STK_StockResult>);

            return(pageList);
        }
Example #7
0
        private void BindDataGridView(int pageIndex)
        {
            STK_StockParam param = new STK_StockParam();

            param.PageIndex   = pageIndex;
            param.PageSize    = 100;
            param.NoItemCodes = NoItemCodes;
            param.Model       = txtModel.Text.Trim();
            PageList <STK_StockResult> lstRst = stockLogic.GetPageList(param);

            dgvStock.DataSource = lstRst.ResultList;
            pgStock.RecordCount = lstRst.TotalCount;
            this.SetDataSource <STK_StockResult>(lstRst.ResultList);
            SetGridCheck(this.dgvStock, _idColName, _chkColName);
        }
Example #8
0
        private void BindStockDataGridView(int pageIndex)
        {
            STK_InLineParam inLineParam = new STK_InLineParam();
            STK_StockParam  stockParam  = new STK_StockParam();

            stockParam.Model = txtModel.Text;
            stockParam.AllowUsableQtyZero = false;
            stockParam.PageIndex          = pageIndex;
            stockParam.PageSize           = 100;
            PageList <STK_StockResult> stockList = this.AsyncExecute <PageList <STK_StockResult>, STK_StockParam>(stockParam, stockLogic.GetPageList, a =>
            {
                stockResultList     = a.ResultList;
                Guid?[] ItemCodes   = stockResultList.Select(o => (Guid?)o.ItemCode).Distinct().ToArray();
                dgvStock.DataSource = stockResultList;
                pgStock.RecordCount = a.TotalCount;
            });
        }
Example #9
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public STK_StockResult GetInfo(STK_StockParam param)
        {
            this.CheckSession();
            STK_StockResult rst = new STK_StockResult();

            #region 判断
            if (param.ItemCode == null)
            {
                throw new WarnException("请指定GUID!");
            }
            #endregion
            #region 获取实体

            rst = this.Select <STK_StockResult>(GetWhereClip(param));

            #endregion
            return(rst);
        }
Example #10
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List <STK_StockResult> GetList(STK_StockParam param)
        {
            this.CheckSession();
            List <STK_StockResult> ret = new List <STK_StockResult>();

            try
            {
                WhereClip whereClip = GetWhereClip(param);
                ret = this.SelectList <STK_StockResult>(whereClip, STK_Stock._.CreatedTime.Asc);
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Example #11
0
        /// <summary>
        /// 分页集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <STK_StockResult> GetPageList(STK_StockParam param)
        {
            this.CheckSession();
            PageList <STK_StockResult> ret = new PageList <STK_StockResult>();

            try
            {
                List <Field> field = new List <Field>()
                {
                    Field.All
                };
                ret = this.SelectList <STK_StockResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), field, GetWhereClip(param), STK_Stock._.CreatedTime.Desc);
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }