Esempio n. 1
0
        /// <summary>
        /// 新增积分订单,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int InsertJiFenDingDan(EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CompanyId) ||
                string.IsNullOrEmpty(info.XiaDanRenId) ||
                string.IsNullOrEmpty(info.ShangPinId))
            {
                return(0);
            }

            info.DingDanId     = Guid.NewGuid().ToString();
            info.IssueTime     = DateTime.Now;
            info.DingDanStatus = EyouSoft.Model.EnumType.YlStructure.JiFenDingDanStatus.已成交;

            int dalRetCode = dal.JiFenDingDan_C(info);

            if (info.FangShi != Model.EnumType.YlStructure.JiFenDuiHuanFangShi.积分现金 && dalRetCode == 1)
            {
                var m = new BLL.YlStructure.BHuiYuan().GetHuiYuanInfo(info.XiaDanRenId);
                var s = dal.GetJiFenShangPinInfo(info.ShangPinId);
                if (m != null && !string.IsNullOrEmpty(m.ShouJi))
                {
                    var content = "尊敬的会员" + m.XingMing + ":您在积分商城成功兑换" + (s != null ? s.MingCheng : string.Empty) + ",该商品将在5个工作日内为您寄出,请保持手机畅通!服务热线:400-665-9099【维诗达游轮网】";
                    EyouSoft.Toolkit.Utils.ProxySMS(m.ShouJi, content);
                }
            }

            return(dalRetCode);
        }
Esempio n. 2
0
        /// <summary>
        /// 新增积分订单,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int JiFenDingDan_C(EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo info)
        {
            DbCommand cmd = _db.GetStoredProcCommand("proc_YL_JiFenDingDan_C");

            _db.AddInParameter(cmd, "@ShangPinId", DbType.AnsiStringFixedLength, info.ShangPinId);
            _db.AddInParameter(cmd, "@CompanyId", DbType.AnsiStringFixedLength, info.CompanyId);
            _db.AddInParameter(cmd, "@DingDanId", DbType.AnsiStringFixedLength, info.DingDanId);
            _db.AddInParameter(cmd, "@JiaoYiHao", DbType.String, info.JiaoYiHao);
            _db.AddInParameter(cmd, "@ShuLiang", DbType.Int32, info.ShuLiang);
            _db.AddInParameter(cmd, "@FangShi", DbType.Byte, info.FangShi);
            _db.AddInParameter(cmd, "@JinE", DbType.Decimal, info.JinE);
            _db.AddInParameter(cmd, "@JiFen", DbType.Decimal, info.JiFen);
            _db.AddInParameter(cmd, "@DingDanStatus", DbType.Byte, info.DingDanStatus);
            _db.AddInParameter(cmd, "@FuKuanStatus", DbType.Byte, info.FuKuanStatus);
            _db.AddInParameter(cmd, "@XiaDanBeiZhu", DbType.String, info.XiaDanBeiZhu);
            _db.AddInParameter(cmd, "@YuDingRenName", DbType.String, info.YuDingRenName);
            _db.AddInParameter(cmd, "@YuDingRenDianHua", DbType.String, info.YuDingRenDianHua);
            _db.AddInParameter(cmd, "@YuDingRenShouJi", DbType.String, info.YuDingRenShouJi);
            _db.AddInParameter(cmd, "@YuDingRenYouXiang", DbType.String, info.YuDingRenYouXiang);
            _db.AddInParameter(cmd, "@IsXuYaoFaPiao", DbType.AnsiStringFixedLength, info.IsXuYaoFaPiao?"1":"0");
            _db.AddInParameter(cmd, "@FaPiaoTaiTou", DbType.String, info.FaPiaoTaiTou);
            _db.AddInParameter(cmd, "@FaPiaoLeiXing", DbType.String, info.FaPiaoLeiXing);
            _db.AddInParameter(cmd, "@FaPiaoMingXi", DbType.String, info.FaPiaoMingXi);
            _db.AddInParameter(cmd, "@FaPiaoPeiSongFangShi", DbType.Byte, info.FaPiaoPeiSongFangShi);
            _db.AddInParameter(cmd, "@FaPiaoDiZhiId", DbType.AnsiStringFixedLength, info.FaPiaoDiZhiId);
            _db.AddInParameter(cmd, "@FaPiaoKuaiDiJinE", DbType.Decimal, info.FaPiaoKuaiDiJinE);
            _db.AddInParameter(cmd, "@XiaDanRenId", DbType.AnsiStringFixedLength, info.XiaDanRenId);
            _db.AddInParameter(cmd, "@IssueTime", DbType.DateTime, info.IssueTime);
            _db.AddInParameter(cmd, "@LiPinDiZhiId", DbType.AnsiStringFixedLength, info.LiPinDiZhiId);
            _db.AddOutParameter(cmd, "@RetCode", DbType.Int32, 4);

            int sqlExceptionCode = 0;

            try
            {
                DbHelper.RunProcedure(cmd, _db);
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                sqlExceptionCode = 0 - e.Number;
            }

            if (sqlExceptionCode < 0)
            {
                return(sqlExceptionCode);
            }
            else
            {
                return(Convert.ToInt32(_db.GetParameterValue(cmd, "RetCode")));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获取积分订单信息
        /// </summary>
        /// <param name="dingDanId">订单编号</param>
        /// <returns></returns>
        public EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo GetJiFenDingDanInfo(string dingDanId)
        {
            EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo info = null;
            DbCommand cmd = _db.GetSqlStringCommand(SQL_SELECT_GetJiFenDingDanInfo);

            _db.AddInParameter(cmd, "DingDanId", DbType.AnsiStringFixedLength, dingDanId);

            using (var rdr = DbHelper.ExecuteReader(cmd, _db))
            {
                if (rdr.Read())
                {
                    info                      = new EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo();
                    info.CompanyId            = rdr["CompanyId"].ToString();
                    info.DingDanId            = rdr["DingDanId"].ToString();
                    info.DingDanStatus        = (EyouSoft.Model.EnumType.YlStructure.JiFenDingDanStatus)rdr.GetByte(rdr.GetOrdinal("DingDanStatus"));
                    info.FangShi              = (EyouSoft.Model.EnumType.YlStructure.JiFenDuiHuanFangShi)rdr.GetByte(rdr.GetOrdinal("FangShi"));
                    info.FaPiaoDiZhiId        = rdr["FaPiaoDiZhiId"].ToString();
                    info.FaPiaoKuaiDiJinE     = rdr.GetDecimal(rdr.GetOrdinal("FaPiaoKuaiDiJinE"));
                    info.FaPiaoLeiXing        = rdr["FaPiaoLeiXing"].ToString();
                    info.FaPiaoMingXi         = rdr["FaPiaoMingXi"].ToString();
                    info.FaPiaoPeiSongFangShi = (EyouSoft.Model.EnumType.YlStructure.FaPiaoPeiSongFangShi)rdr.GetByte(rdr.GetOrdinal("FaPiaoPeiSongFangShi"));
                    info.FaPiaoTaiTou         = rdr["FaPiaoTaiTou"].ToString();
                    info.FuKuanStatus         = (EyouSoft.Model.EnumType.YlStructure.FuKuanStatus)rdr.GetByte(rdr.GetOrdinal("FuKuanStatus"));
                    info.IssueTime            = rdr.GetDateTime(rdr.GetOrdinal("IssueTime"));
                    info.IsXuYaoFaPiao        = rdr["IsXuYaoFaPiao"].ToString() == "1";
                    info.JiaoYiHao            = rdr["JiaoYiHao"].ToString();
                    info.JiFen                = rdr.GetDecimal(rdr.GetOrdinal("JiFen"));
                    info.JinE                 = rdr.GetDecimal(rdr.GetOrdinal("JinE"));
                    info.ShangPinId           = rdr["ShangPinId"].ToString();
                    info.ShuLiang             = rdr.GetInt32(rdr.GetOrdinal("ShuLiang"));
                    info.XiaDanBeiZhu         = rdr["XiaDanBeiZhu"].ToString();
                    info.XiaDanRenId          = rdr["XiaDanRenId"].ToString();
                    info.YuDingRenDianHua     = rdr["YuDingRenDianHua"].ToString();
                    info.YuDingRenName        = rdr["YuDingRenName"].ToString();
                    info.YuDingRenShouJi      = rdr["YuDingRenShouJi"].ToString();
                    info.YuDingRenYouXiang    = rdr["YuDingRenYouXiang"].ToString();
                    info.ShangPinMingCheng    = rdr["ShangPinMingCheng"].ToString();
                    info.HuiYuanXingMing      = rdr["HuiYuanXingMing"].ToString();
                    info.HuiYuanZhangHao      = rdr["HuiYuanZhangHao"].ToString();
                    info.LiPinDiZhiId         = rdr["LiPinDiZhiId"].ToString();
                    info.IdentityId           = rdr.GetInt32(rdr.GetOrdinal("IdentityId"));
                    info.ShangPinJinE         = rdr.GetDecimal(rdr.GetOrdinal("ShangPinJinE"));
                }
            }

            return(info);
        }
Esempio n. 4
0
        /// <summary>
        /// 获取积分订单集合
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="pageSize">页记录数</param>
        /// <param name="pageIndex">页序号</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="chaXun">查询</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo> GetJiFenDingDans(string companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.YlStructure.MWzJiFenDingDanChaXunInfo chaXun)
        {
            IList <EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo> items = new List <EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo>();
            string        tableName     = "view_YL_JiFenDingDan";
            string        fields        = "*";
            string        orderByString = "IssueTime DESC";
            string        sumString     = string.Empty;
            StringBuilder sql           = new StringBuilder();

            sql.AppendFormat(" CompanyId='{0}' ", companyId);

            if (chaXun != null)
            {
                if (!string.IsNullOrEmpty(chaXun.HuiYuanId))
                {
                    sql.AppendFormat(" AND XiaDanRenId='{0}' ", chaXun.HuiYuanId);
                }
                if (chaXun.DingDanStatus.HasValue)
                {
                    sql.AppendFormat(" AND DingDanStatus={0} ", (int)chaXun.DingDanStatus);
                }
                if (chaXun.FuKuanStatus.HasValue)
                {
                    sql.AppendFormat(" AND FuKuanStatus={0} ", (int)chaXun.FuKuanStatus);
                }
                if (!string.IsNullOrEmpty(chaXun.ShangPinMingCheng))
                {
                    sql.AppendFormat(" AND ShangPinMingCheng LIKE '%{0}%' ", chaXun.ShangPinMingCheng);
                }
                if (chaXun.XiaDanShiJian1.HasValue)
                {
                    sql.AppendFormat(" AND IssueTime>='{0}' ", chaXun.XiaDanShiJian1.Value);
                }
                if (chaXun.XiaDanShiJian2.HasValue)
                {
                    sql.AppendFormat(" AND IssueTime<='{0}' ", chaXun.XiaDanShiJian2.Value.AddDays(1).AddMinutes(-1));
                }
                if (!string.IsNullOrEmpty(chaXun.JiaoYiHao))
                {
                    sql.AppendFormat(" AND JiaoYiHao LIKE '%{0}%' ", chaXun.JiaoYiHao);
                }
            }

            using (IDataReader rdr = DbHelper.ExecuteReader1(_db, pageSize, pageIndex, ref recordCount, tableName, fields.ToString(), sql.ToString(), orderByString, sumString))
            {
                while (rdr.Read())
                {
                    var info = new EyouSoft.Model.YlStructure.MWzJiFenDingDanInfo();
                    info.CompanyId            = rdr["CompanyId"].ToString();
                    info.DingDanId            = rdr["DingDanId"].ToString();
                    info.DingDanStatus        = (EyouSoft.Model.EnumType.YlStructure.JiFenDingDanStatus)rdr.GetByte(rdr.GetOrdinal("DingDanStatus"));
                    info.FangShi              = (EyouSoft.Model.EnumType.YlStructure.JiFenDuiHuanFangShi)rdr.GetByte(rdr.GetOrdinal("FangShi"));
                    info.FaPiaoDiZhiId        = rdr["FaPiaoDiZhiId"].ToString();
                    info.FaPiaoKuaiDiJinE     = rdr.GetDecimal(rdr.GetOrdinal("FaPiaoKuaiDiJinE"));
                    info.FaPiaoLeiXing        = rdr["FaPiaoLeiXing"].ToString();
                    info.FaPiaoMingXi         = rdr["FaPiaoMingXi"].ToString();
                    info.FaPiaoPeiSongFangShi = (EyouSoft.Model.EnumType.YlStructure.FaPiaoPeiSongFangShi)rdr.GetByte(rdr.GetOrdinal("FaPiaoPeiSongFangShi"));
                    info.FaPiaoTaiTou         = rdr["FaPiaoTaiTou"].ToString();
                    info.FuKuanStatus         = (EyouSoft.Model.EnumType.YlStructure.FuKuanStatus)rdr.GetByte(rdr.GetOrdinal("FuKuanStatus"));
                    info.IssueTime            = rdr.GetDateTime(rdr.GetOrdinal("IssueTime"));
                    info.IsXuYaoFaPiao        = rdr["IsXuYaoFaPiao"].ToString() == "1";
                    info.JiaoYiHao            = rdr["JiaoYiHao"].ToString();
                    info.JiFen             = rdr.GetDecimal(rdr.GetOrdinal("JiFen"));
                    info.JinE              = rdr.GetDecimal(rdr.GetOrdinal("JinE"));
                    info.ShangPinId        = rdr["ShangPinId"].ToString();
                    info.ShuLiang          = rdr.GetInt32(rdr.GetOrdinal("ShuLiang"));
                    info.XiaDanBeiZhu      = rdr["XiaDanBeiZhu"].ToString();
                    info.XiaDanRenId       = rdr["XiaDanRenId"].ToString();
                    info.YuDingRenDianHua  = rdr["YuDingRenDianHua"].ToString();
                    info.YuDingRenName     = rdr["YuDingRenName"].ToString();
                    info.YuDingRenShouJi   = rdr["YuDingRenShouJi"].ToString();
                    info.YuDingRenYouXiang = rdr["YuDingRenYouXiang"].ToString();
                    info.ShangPinMingCheng = rdr["ShangPinMingCheng"].ToString();
                    info.HuiYuanXingMing   = rdr["HuiYuanXingMing"].ToString();

                    items.Add(info);
                }
            }

            return(items);
        }