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

            try
            {
                #region 判断
                if (param.StkInLineGuid == null)
                {
                    throw new WarnException("请指定明细GUID!");
                }
                #endregion
                WhereClip        whereClip = GetWhereClip(param);
                STK_InLineResult info      = new STK_InLineResult();
                info.IsDeleted = true;
                affect         = this.Update <STK_InLineResult>(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);
        }
Beispiel #2
0
        public WCFAddUpdateResult DelInfo(STK_InLineParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_InLineBLL", "DelInfo", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Beispiel #3
0
        public STK_InLineResult GetInfo(STK_InLineParam param)
        {
            STK_InLineResult ret = new STK_InLineResult();
            ExeResult        rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_InLineBLL", "GetInfo", param);
            ret = rst == null ? new STK_InLineResult() : rst.Result as STK_InLineResult;
            return(ret);
        }
Beispiel #4
0
        public PageList <STK_InLineResult> GetPageList(STK_InLineParam param)
        {
            ExeResult rst = new ExeResult();

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

            pageList = (rst == null ? new PageList <STK_InLineResult>() : rst.Result as PageList <STK_InLineResult>);
            return(pageList);
        }
Beispiel #5
0
        public List <STK_InLineResult> GetList(STK_InLineParam param)
        {
            ExeResult rst = new ExeResult();

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

            list = (rst == null ? new List <STK_InLineResult>() : rst.Result as List <STK_InLineResult>);
            return(list);
        }
Beispiel #6
0
        /// <summary>
        /// 获取入库明细的分页信息
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <STK_InLineResult> GetPageList(STK_InLineParam param)
        {
            PageList <STK_InLineResult> ret = new PageList <STK_InLineResult>();

            try
            {
                STK_InParam InParam = new STK_InParam()
                {
                    SourceBillNo = param.SourceBillNo,
                    BillNo       = param.StkInBillNo,
                    PageIndex    = 1,
                    PageSize     = 5000,
                    Status       = param.Status
                };
                STK_InBLL inBLL = new STK_InBLL();
                inBLL.SessionInfo = this.SessionInfo;
                PageList <STK_InResult> inList = inBLL.GetPageList(InParam);
                if (inList != null && inList.ResultList.Count > 0)
                {
                    Guid?[] StkInGuids = inList.ResultList.Select(a => (Guid?)a.StkInGuid).Distinct().ToArray();
                    param.StkInGuids = StkInGuids;

                    ret = this.SelectList <STK_InLineResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), new List <Field>()
                    {
                        Field.All
                    }, GetWhereClip(param), STK_OutLine._.CreatedTime.Desc);
                    if (ret != null && ret.ResultList.Count > 0)
                    {
                        foreach (STK_InLineResult inLineResult in ret.ResultList)
                        {
                            //获取入库单号
                            STK_InResult inResult = inList.ResultList.FirstOrDefault(a => a.StkInGuid == inLineResult.StkInGuid);
                            if (inResult != null)
                            {
                                inLineResult.StkInBillNo  = inResult.BillNo;
                                inLineResult.SourceBillNo = inResult.SourceBillNo;
                            }
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Beispiel #7
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;
            });
        }
Beispiel #8
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public STK_InLineResult GetInfo(STK_InLineParam param)
        {
            this.CheckSession();
            STK_InLineResult rst = new STK_InLineResult();

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

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

            #endregion
            return(rst);
        }
Beispiel #9
0
 WhereClip GetWhereClip(STK_InLineParam param)
 {
     this.CheckSession();
     WhereClip where = STK_InLine._.IsDeleted == 0;
     if (param.StkInGuid != null)
     {
         where = where && STK_InLine._.StkInGuid == param.StkInGuid;
     }
     if (param.StkInLineGuid != null)
     {
         where = where && STK_InLine._.StkInLineGuid == param.StkInLineGuid;
     }
     if (param.StkInLineGuids != null && param.StkInLineGuids.Length > 0)
     {
         where = where && STK_InLine._.StkInLineGuid.In(param.StkInLineGuids);
     }
     if (param.SourceBillGuid != null)
     {
         where = where && STK_InLine._.SourceBillGuid == param.SourceBillGuid;
     }
     if (param.SourceBillLineGuids != null && param.SourceBillLineGuids.Length > 0)
     {
         where = where && STK_InLine._.SourceBillLineGuid.In(param.SourceBillLineGuids);
     }
     if (!string.IsNullOrEmpty(param.Model))
     {
         where = where && STK_InLine._.Model.Like("%" + param.Model + "%");
     }
     if (param.SOLineGuids != null && param.SOLineGuids.Length > 0)
     {
         where = where && STK_InLine._.SOLineGuid.In(param.SOLineGuids);
     }
     if (param.ItemCode != null)
     {
         where = where && STK_InLine._.ItemCode == param.ItemCode;
     }
     if (param.ItemCodes != null && param.ItemCodes.Length > 0)
     {
         where = where && STK_InLine._.ItemCode.In(param.ItemCodes);
     }
     return(where);
 }
Beispiel #10
0
        private void BindDataGridView(int pageIndex)
        {
            STK_InLineParam param = new STK_InLineParam();

            param.PageIndex      = pageIndex;
            param.PageSize       = 100;
            param.SourceBillGuid = SourceBillGuid;
            param.SourceBillNo   = txtSourceBillNo.Text.Trim();
            param.StkInLineGuid  = StkInLineGuid;
            param.StkInBillNo    = txtStkOutBillNo.Text.Trim();
            param.Model          = txtModel.Text.Trim();
            param.Status         = "Complete"; //审核完成
            param.IsReturnOver   = false;      //未退完
            PageList <STK_InLineResult> lstRst = inLineLogic.GetPageList(param);

            dgvStkInLine.DataSource = lstRst.ResultList;
            pgStkInLine.RecordCount = lstRst.TotalCount;
            this.SetDataSource <STK_InLineResult>(lstRst.ResultList);
            SetGridCheck(this.dgvStkInLine, _idColName, _chkColName);
        }
Beispiel #11
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List <STK_InLineResult> GetList(STK_InLineParam param)
        {
            this.CheckSession();
            List <STK_InLineResult> ret = new List <STK_InLineResult>();

            try
            {
                WhereClip whereClip = GetWhereClip(param);
                ret = this.SelectList <STK_InLineResult>(whereClip, STK_InLine._.CreatedTime.Asc);
                if (ret != null && ret.Count > 0)
                {
                    Guid?[]   StkInGuids = ret.Select(a => a.StkInGuid).Distinct().ToArray();
                    STK_InBLL stkInBLL   = new STK_InBLL();
                    stkInBLL.SessionInfo = this.SessionInfo;
                    List <STK_InResult> inResultList = stkInBLL.GetList(new STK_InParam()
                    {
                        StkInGuids = StkInGuids
                    });
                    foreach (STK_InLineResult inLineResult in ret)
                    {
                        STK_InResult inResult = inResultList.FirstOrDefault(a => a.StkInGuid == inLineResult.StkInGuid);
                        if (inResult != null)
                        {
                            inLineResult.StkInBillNo  = inResult.BillNo;
                            inLineResult.SourceBillNo = inResult.SourceBillNo;
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }