コード例 #1
0
 WhereClip GetWhereClip(ORD_SalesOrderLineParam param)
 {
     this.CheckSession();
     WhereClip where = ORD_SalesOrderLine._.IsDeleted == 0;
     if (param.IsCancel != null)
     {
         where = where && ORD_SalesOrderLine._.IsCancel == param.IsCancel;
     }
     if (param.SOLineID > 0)
     {
         where = where && ORD_SalesOrderLine._.SOLineID == param.SOLineID;
     }
     if (param.SOLineGuid != null)
     {
         where = where && ORD_SalesOrderLine._.SOLineGuid == param.SOLineGuid;
     }
     if (param.SOGuid != null)
     {
         where = where && ORD_SalesOrderLine._.SOGuid == param.SOGuid;
     }
     if (param.SOGuids != null && param.SOGuids.Length > 0)
     {
         where = where && ORD_SalesOrderLine._.SOGuid.In(param.SOGuids);
     }
     if (param.SOLineGuids != null && param.SOLineGuids.Length > 0)
     {
         where = where && ORD_SalesOrderLine._.SOLineGuid.In(param.SOLineGuids);
     }
     if (!string.IsNullOrEmpty(param.Model))
     {
         where = where && ORD_SalesOrderLine._.Model.Like("%" + param.Model + "%");
     }
     return(where);
 }
コード例 #2
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(ORD_SalesOrderLineParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.SOLineGuid == null)
                {
                    throw new WarnException("请指定明细GUID!");
                }
                #endregion
                WhereClip whereClip           = GetWhereClip(param);
                ORD_SalesOrderLineResult info = new ORD_SalesOrderLineResult();
                info.IsDeleted = true;
                affect         = this.Update <ORD_SalesOrderLineResult>(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);
        }
コード例 #3
0
ファイル: frmPurchaseNotice.cs プロジェクト: windygu/CRM
        private void BindSuperGrid()
        {
            ORD_SalesOrderLineParam param = new ORD_SalesOrderLineParam();

            param.SOGuid     = SOGuid;
            param.Model      = txtModel.Text.Trim();
            param.SOLineCode = txtSOLineCode.Text.Trim();
            param.IsCancel   = false;
            GridPanel noNoticedPanel = usgNoNoticed.PrimaryGrid;
            List <ORD_SalesOrderLineResult> lineResultList   = orderLineLogic.GetList(param);
            List <ORD_PurchaseNoticeResult> noticeResultList = new List <ORD_PurchaseNoticeResult>();

            if (lineResultList != null && lineResultList.Count > 0)
            {
                noNoticedPanel.DataSource = lineResultList;
                Guid?[] SOLineGuids = lineResultList.Select(a => (Guid?)a.SOLineGuid).Distinct().ToArray();
                ORD_PurchaseNoticeParam noticeParam = new ORD_PurchaseNoticeParam();
                noticeParam.SOLineGuids = SOLineGuids;
                noticeResultList        = noticeLogic.GetList(noticeParam);
            }
            GridPanel noticedPanel = usgNoticed.PrimaryGrid;

            if (noticeResultList != null && noticeResultList.Count > 0)
            {
                noticedPanel.DataSource = noticeResultList;
            }
        }
コード例 #4
0
        public WCFAddUpdateResult DelInfo(ORD_SalesOrderLineParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.SPM.ORD_SalesOrderLineBLL", "DelInfo", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
コード例 #5
0
        public ORD_SalesOrderLineResult GetInfo(ORD_SalesOrderLineParam param)
        {
            ORD_SalesOrderLineResult ret = new ORD_SalesOrderLineResult();
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.SPM.ORD_SalesOrderLineBLL", "GetInfo", param);
            ret = rst == null ? new ORD_SalesOrderLineResult() : rst.Result as ORD_SalesOrderLineResult;
            return(ret);
        }
コード例 #6
0
        public List <ORD_SalesOrderLineResult> GetList(ORD_SalesOrderLineParam param)
        {
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.SPM.ORD_SalesOrderLineBLL", "GetList", param);
            List <ORD_SalesOrderLineResult> list = new List <ORD_SalesOrderLineResult>();

            list = (rst == null ? new List <ORD_SalesOrderLineResult>() : rst.Result as List <ORD_SalesOrderLineResult>);
            return(list);
        }
コード例 #7
0
ファイル: ORD_PurchaseNoticeBLL.cs プロジェクト: windygu/CRM
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List <ORD_PurchaseNoticeResult> GetList(ORD_PurchaseNoticeParam param)
        {
            this.CheckSession();
            List <ORD_PurchaseNoticeResult> ret = new List <ORD_PurchaseNoticeResult>();

            try
            {
                WhereClip whereClip = GetWhereClip(param);
                ret = this.SelectList <ORD_PurchaseNoticeResult>(whereClip, ORD_PurchaseNotice._.CreatedTime.Asc);
                if (ret != null && ret.Count > 0)
                {
                    Guid?[] SOLineGuids           = ret.Where(a => a.SOLineGuid.ToGuid() != Guid.Empty).Select(a => a.SOLineGuid).Distinct().ToArray();
                    ORD_SalesOrderLineBLL lineBLL = new ORD_SalesOrderLineBLL();
                    lineBLL.SessionInfo = this.SessionInfo;
                    ORD_SalesOrderLineParam lineParam = new ORD_SalesOrderLineParam();
                    lineParam.SOLineGuids = SOLineGuids;
                    List <ORD_SalesOrderLineResult> lineResultList = lineBLL.GetList(lineParam);
                    if (ret != null && ret.Count > 0 && lineResultList != null && lineResultList.Count > 0)
                    {
                        foreach (ORD_PurchaseNoticeResult noticeResult in ret)
                        {
                            ORD_SalesOrderLineResult lineResult = lineResultList.FirstOrDefault(a => a.SOLineGuid == noticeResult.SOLineGuid);
                            if (lineResult != null)
                            {
                                noticeResult.SOLineCode       = lineResult.SOLineCode;
                                noticeResult.SalePrice        = lineResult.UnitPrice;
                                noticeResult.Unit             = lineResult.Unit;
                                noticeResult.Model            = lineResult.Model;
                                noticeResult.Brand            = lineResult.Brand;
                                noticeResult.Batch            = lineResult.Batch;
                                noticeResult.Package          = lineResult.Package;
                                noticeResult.InvType          = lineResult.InvType;
                                noticeResult.NeedDeliveryDate = lineResult.NeedDeliveryDate;
                                noticeResult.SaleQty          = lineResult.Qty;
                            }
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
コード例 #8
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ORD_SalesOrderLineResult GetInfo(ORD_SalesOrderLineParam param)
        {
            this.CheckSession();
            ORD_SalesOrderLineResult rst = new ORD_SalesOrderLineResult();

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

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

            #endregion
            return(rst);
        }
コード例 #9
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List <ORD_SalesOrderLineResult> GetList(ORD_SalesOrderLineParam param)
        {
            this.CheckSession();
            List <ORD_SalesOrderLineResult> ret = new List <ORD_SalesOrderLineResult>();

            try
            {
                WhereClip whereClip = GetWhereClip(param);
                ret = this.SelectList <ORD_SalesOrderLineResult>(whereClip, ORD_SalesOrderLine._.CreatedTime.Asc);
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
コード例 #10
0
        /// <summary>
        /// 获取销售明细的分页信息
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <ORD_SalesOrderLineResult> GetPageList(ORD_SalesOrderLineParam param)
        {
            PageList <ORD_SalesOrderLineResult> ret = new PageList <ORD_SalesOrderLineResult>();

            try
            {
                ret = this.SelectList <ORD_SalesOrderLineResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), new List <Field> {
                    Field.All
                }, GetWhereClip(param), ORD_SalesOrderLine._.CreatedTime.Desc);
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
コード例 #11
0
ファイル: ORD_PurchaseNoticeBLL.cs プロジェクト: windygu/CRM
        public PageList <ORD_PurchaseNoticeResult> GetPageList(ORD_PurchaseNoticeParam param)
        {
            PageList <ORD_PurchaseNoticeResult> ret = new PageList <ORD_PurchaseNoticeResult>();

            try
            {
                ORD_SalesOrderBLL orderBLL = new ORD_SalesOrderBLL();
                orderBLL.SessionInfo = this.SessionInfo;
                ORD_SalesOrderParam orderParam = new ORD_SalesOrderParam()
                {
                    BillNo    = param.SOBillNo,
                    SalerName = param.SalerName,
                    PageIndex = 1,
                    PageSize  = 5000
                };

                PageList <ORD_SalesOrderResult> orderList = orderBLL.GetPageList(orderParam);
                if (orderList.ResultList != null && orderList.ResultList.Count > 0)
                {
                    Guid?[] SOGuids = orderList.ResultList.Select(a => a.SOGuid).Distinct().ToArray();
                    ORD_SalesOrderLineBLL lineBLL = new ORD_SalesOrderLineBLL();
                    lineBLL.SessionInfo = this.SessionInfo;
                    ORD_SalesOrderLineParam lineParam = new ORD_SalesOrderLineParam()
                    {
                        Model      = param.Model,
                        SOLineCode = param.SOLineCode,
                        SOGuids    = SOGuids,
                        PageIndex  = 1,
                        PageSize   = 5000,
                        IsCancel   = false
                    };
                    PageList <ORD_SalesOrderLineResult> lineList = lineBLL.GetPageList(lineParam);
                    if (lineList.ResultList != null && lineList.ResultList.Count > 0)
                    {
                        Guid?[] SOLineGuIds = lineList.ResultList.Select(a => (Guid?)a.SOLineGuid).Distinct().ToArray();
                        param.SOLineGuids = SOLineGuIds;
                        ret = this.SelectList <ORD_PurchaseNoticeResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), new List <Field>()
                        {
                            Field.All
                        }, GetWhereClip(param), ORD_PurchaseNotice._.CreatedTime.Desc);
                        foreach (ORD_PurchaseNoticeResult noticeResult in ret.ResultList)
                        {
                            ORD_SalesOrderResult orderResult = orderList.ResultList.FirstOrDefault(a => a.SOGuid == noticeResult.SOGuid);
                            if (orderResult != null)
                            {
                                noticeResult.SOBillNo     = orderResult.BillNo;
                                noticeResult.SalerName    = orderResult.SalerName;
                                noticeResult.SaleCurrency = orderResult.Currency;
                            }
                            ORD_SalesOrderLineResult lineResult = lineList.ResultList.FirstOrDefault(a => a.SOLineGuid == noticeResult.SOLineGuid);
                            if (lineResult != null)
                            {
                                noticeResult.SOLineCode       = lineResult.SOLineCode;
                                noticeResult.SalePrice        = lineResult.UnitPrice;
                                noticeResult.Unit             = lineResult.Unit;
                                noticeResult.Model            = lineResult.Model;
                                noticeResult.Brand            = lineResult.Brand;
                                noticeResult.Batch            = lineResult.Batch;
                                noticeResult.Package          = lineResult.Package;
                                noticeResult.InvType          = lineResult.InvType;
                                noticeResult.NeedDeliveryDate = lineResult.NeedDeliveryDate;
                                noticeResult.SaleQty          = lineResult.Qty;
                            }
                            if (noticeResult.PurchaseQty.ToInt32() == 0)
                            {
                                noticeResult.PurStatus = "未采购";
                            }
                            else if (noticeResult.NoticeQty.ToInt32() <= noticeResult.PurchaseQty.ToInt32())
                            {
                                noticeResult.PurStatus = "采购完成";
                            }
                            else
                            {
                                noticeResult.PurStatus = "部分采购";
                            }
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }