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

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

            rst = this.Execute("ZNLCRM.BLL.STK.STK_OutLineBLL", "DelInfo", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Ejemplo n.º 3
0
        public STK_OutLineResult GetInfo(STK_OutLineParam param)
        {
            STK_OutLineResult ret = new STK_OutLineResult();
            ExeResult         rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.STK.STK_OutLineBLL", "GetInfo", param);
            ret = rst == null ? new STK_OutLineResult() : rst.Result as STK_OutLineResult;
            return(ret);
        }
Ejemplo n.º 4
0
        public PageList <STK_OutLineResult> GetPageList(STK_OutLineParam param)
        {
            ExeResult rst = new ExeResult();

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

            pageList = (rst == null ? new PageList <STK_OutLineResult>() : rst.Result as PageList <STK_OutLineResult>);
            return(pageList);
        }
Ejemplo n.º 5
0
        public List <STK_OutLineResult> GetList(STK_OutLineParam param)
        {
            ExeResult rst = new ExeResult();

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

            list = (rst == null ? new List <STK_OutLineResult>() : rst.Result as List <STK_OutLineResult>);
            return(list);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List <STK_OutLineResult> GetList(STK_OutLineParam param)
        {
            this.CheckSession();
            List <STK_OutLineResult> ret = new List <STK_OutLineResult>();

            try
            {
                WhereClip whereClip = GetWhereClip(param);
                ret = this.SelectList <STK_OutLineResult>(whereClip, STK_OutLine._.CreatedTime.Asc);
                if (ret != null && ret.Count > 0)
                {
                    Guid?[]    StkOutGuids = ret.Select(a => a.StkOutGuid).Distinct().ToArray();
                    Guid?[]    ItemCodes   = ret.Select(a => a.ItemCode).Distinct().ToArray();
                    STK_OutBLL stkOutBLL   = new STK_OutBLL();
                    stkOutBLL.SessionInfo = this.SessionInfo;
                    List <STK_OutResult> outResultList = stkOutBLL.GetList(new STK_OutParam()
                    {
                        StkOutGuids = StkOutGuids
                    });
                    STK_StockBLL stockBLL = new STK_StockBLL();
                    stockBLL.SessionInfo = this.SessionInfo;
                    List <STK_StockResult> stockResultList = stockBLL.GetList(new STK_StockParam()
                    {
                        ItemCodes = ItemCodes
                    });
                    foreach (STK_OutLineResult outLineResult in ret)
                    {
                        STK_OutResult outResult = outResultList.FirstOrDefault(a => a.StkOutGuid == outLineResult.StkOutGuid);
                        if (outResult != null)
                        {
                            outLineResult.StkOutBillNo = outResult.BillNo;
                            outLineResult.SourceBillNo = outResult.SourceBillNo;
                        }
                        STK_StockResult stockResult = stockResultList.FirstOrDefault(a => a.ItemCode == outLineResult.ItemCode);
                        if (stockResult != null)
                        {
                            outLineResult.BuyerID   = stockResult.BuyerID;
                            outLineResult.BuyerName = stockResult.BuyerName;
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取出库明细的分页信息
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <STK_OutLineResult> GetPageList(STK_OutLineParam param)
        {
            PageList <STK_OutLineResult> ret = new PageList <STK_OutLineResult>();

            try
            {
                STK_OutParam outParam = new STK_OutParam()
                {
                    SourceBillNo = param.SourceBillNo,
                    BillNo       = param.StkOutBillNo,
                    PageIndex    = 1,
                    PageSize     = 5000,
                    Status       = param.Status
                };
                STK_OutBLL outBLL = new STK_OutBLL();
                outBLL.SessionInfo = this.SessionInfo;
                PageList <STK_OutResult> outList = outBLL.GetPageList(outParam);
                if (outList != null && outList.ResultList.Count > 0)
                {
                    Guid?[] StkOutGuids = outList.ResultList.Select(a => (Guid?)a.StkOutGuid).Distinct().ToArray();
                    param.StkOutGuids = StkOutGuids;

                    ret = this.SelectList <STK_OutLineResult>(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_OutLineResult outLineResult in ret.ResultList)
                        {
                            //获取出库单号
                            STK_OutResult outResult = outList.ResultList.FirstOrDefault(a => a.StkOutGuid == outLineResult.StkOutGuid);
                            if (outResult != null)
                            {
                                outLineResult.StkOutBillNo = outResult.BillNo;
                                outLineResult.SourceBillNo = outResult.SourceBillNo;
                            }
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public STK_OutLineResult GetInfo(STK_OutLineParam param)
        {
            this.CheckSession();
            STK_OutLineResult rst = new STK_OutLineResult();

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

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

            #endregion
            return(rst);
        }
Ejemplo n.º 9
0
        private void BindDataGridView(int pageIndex)
        {
            STK_OutLineParam param = new STK_OutLineParam();

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

            dgvStkOutLine.DataSource = lstRst.ResultList;
            pgStkOutLine.RecordCount = lstRst.TotalCount;
            this.SetDataSource <STK_OutLineResult>(lstRst.ResultList);
            SetGridCheck(this.dgvStkOutLine, _idColName, _chkColName);
        }
Ejemplo n.º 10
0
        WhereClip GetWhereClip(STK_OutLineParam param)
        {
            this.CheckSession();

            WhereClip where = STK_OutLine._.IsDeleted == 0;
            if (param.StkOutGuid != null)
            {
                where = where && STK_OutLine._.StkOutGuid == param.StkOutGuid;
            }
            if (param.StkOutGuids != null)
            {
                where = where && STK_OutLine._.StkOutGuid.In(param.StkOutGuids);
            }
            if (param.StkOutLineGuid != null)
            {
                where = where && STK_OutLine._.StkOutLineGuid == param.StkOutLineGuid;
            }
            if (param.SourceBillGuid != null)
            {
                where = where && STK_OutLine._.SourceBillGuid == param.SourceBillGuid;
            }
            if (!string.IsNullOrEmpty(param.Model))
            {
                where = where && STK_OutLine._.Model.Like("%" + param.Model + "%");
            }
            if (param.IsReturnOver != null && !param.IsReturnOver.ToBooleanHasNull())
            {
                where = where && STK_OutLine._.Qty > STK_OutLine._.ReturnOccQty.ToInt32();
            }
            if (param.StkOutLineGuids != null && param.StkOutLineGuids.Length > 0)
            {
                where = where && STK_OutLine._.StkOutLineGuid.In(param.StkOutLineGuids);
            }
            if (param.NoStkOutLineGuids != null && param.NoStkOutLineGuids.Length > 0)
            {
                where = where && !STK_OutLine._.StkOutLineGuid.In(param.NoStkOutLineGuids);
            }
            return(where);
        }