Ejemplo n.º 1
0
        public virtual object SplitSOPointLog(int customerSysNo, BizEntity.SO.SOBaseInfo master, List <BizEntity.SO.SOBaseInfo> subSoList)
        {
            object o = null;
            //先给obtain表添加原来母单消费的积分  //然后重新记录子订单消费的积分信息
            CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("Invoice.AddNewPointForSplitSO");

            cmd.AddInputParameter("@CustomerSysno", DbType.Int32, customerSysNo);
            cmd.AddInputParameter("@Point", DbType.Int32, master.PointPay);
            cmd.AddInputParameter("@ObtainType", DbType.Int32, AdjustPointType.UpdateSO);
            cmd.AddInputParameter("@Memo", DbType.String, ResouceManager.GetMessageString("Customer.CustomerPointsAddRequest", "SplitSOPointLogMemo_Obtain"));
            cmd.SetParameterValueAsCurrentUserSysNo("@InUser");
            cmd.AddInputParameter("@SoSysNo", DbType.Int32, master.SysNo);
            cmd.AddInputParameter("@CompanyCode", DbType.AnsiStringFixedLength, master.CompanyCode);
            cmd.AddOutParameter("@returnCode", DbType.Int32, 0);
            cmd.CommandTimeout = 120;
            cmd.ExecuteNonQuery();
            object obj = cmd.GetParameterValue("@returnCode");

            if (Convert.ToString(obj) != "1000099")
            {
                return(obj);
            }
            else
            {
                //然后重新记录子订单消费的积分信息

                foreach (BizEntity.SO.SOBaseInfo subentity in subSoList)
                {
                    CustomDataCommand cmdSub = DataCommandManager.CreateCustomDataCommandFromConfig("Invoice.ConsumePointForSplitSO");
                    cmdSub.AddInputParameter("@CustomerSysno", DbType.Int32, master.CustomerSysNo);
                    cmdSub.AddInputParameter("@Point", DbType.Int32, subentity.PointPay);
                    cmdSub.AddInputParameter("@ConsumeType", DbType.Int32, AdjustPointType.CreateOrder);
                    cmdSub.AddInputParameter("@Memo", DbType.String, ResouceManager.GetMessageString("Customer.CustomerPointsAddRequest", "SplitSOPointLogMemo_Consume"));
                    cmdSub.SetParameterValueAsCurrentUserSysNo("@InUser");
                    cmdSub.AddInputParameter("@SoSysNo", DbType.Int32, subentity.SysNo);
                    cmdSub.AddInputParameter("@CompanyCode", DbType.AnsiStringFixedLength, master.CompanyCode);
                    cmdSub.AddOutParameter("@returnCode", DbType.Int32, 0);
                    cmdSub.CommandTimeout = 120;
                    cmdSub.ExecuteNonQuery();
                    o = cmdSub.GetParameterValue("@returnCode");
                }
                return(o);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 调整顾客积分预检查
        /// </summary>
        /// <param name="adujstInfo"></param>
        /// <returns></returns>
        public virtual object AdjustPointPreCheck(AdjustPointRequest adujstInfo)
        {
            CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("Invoice.AdjustPointPreCheck");

            cmd.AddInputParameter("@CustomerSysno", DbType.Int32, adujstInfo.CustomerSysNo);
            cmd.AddInputParameter("@Point", DbType.Int32, adujstInfo.Point);
            cmd.AddInputParameter("@PointType", DbType.Int32, adujstInfo.PointType);
            cmd.AddInputParameter("@Source", DbType.String, adujstInfo.Source);
            cmd.AddInputParameter("@Memo", DbType.String, adujstInfo.Memo);
            cmd.SetParameterValueAsCurrentUserSysNo("@InUser");
            cmd.AddInputParameter("@OperationType", DbType.Int32, adujstInfo.OperationType);
            cmd.AddInputParameter("@SoSysNo", DbType.Int32, adujstInfo.SOSysNo);
            cmd.AddInputParameter("@ExpireDate", DbType.DateTime, adujstInfo.PointExpiringDate);
            cmd.AddOutParameter("@returnCode", DbType.Int32, 0);
            cmd.CommandTimeout = 120;
            cmd.ExecuteNonQuery();
            object obj = cmd.GetParameterValue("@returnCode");

            return(obj);
        }