Пример #1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(Eyousoft_yhq.Model.Order model)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_Order_Add");

            this._db.AddInParameter(cmd, "OrderID", DbType.AnsiStringFixedLength, model.OrderID);
            this._db.AddInParameter(cmd, "ProductID", DbType.AnsiStringFixedLength, model.ProductID);
            this._db.AddOutParameter(cmd, "OrderCode", DbType.AnsiStringFixedLength, 255);
            this._db.AddInParameter(cmd, "MemberID", DbType.AnsiStringFixedLength, model.MemberID);
            this._db.AddInParameter(cmd, "MemberName", DbType.String, model.MemberName);
            this._db.AddInParameter(cmd, "MemberTel", DbType.String, model.MemberTel);
            this._db.AddInParameter(cmd, "MemberSex", DbType.Byte, (int)model.MemberSex);
            this._db.AddInParameter(cmd, "OrderState", DbType.Byte, (int)model.OrderState);
            this._db.AddInParameter(cmd, "PayState", DbType.Byte, (int)model.PayState);
            this._db.AddInParameter(cmd, "IsCheck", DbType.AnsiStringFixedLength, this.GetBooleanToStr(model.IsCheck));
            this._db.AddInParameter(cmd, "ConfirmCode", DbType.String, model.ConfirmCode);
            this._db.AddInParameter(cmd, "OrderPrice", DbType.Decimal, model.OrderPrice);
            this._db.AddInParameter(cmd, "PeopleNum", DbType.Int32, model.PeopleNum);
            this._db.AddInParameter(cmd, "Remark", DbType.String, model.Remark);

            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);
            _db.AddInParameter(cmd, "WeiDianId", DbType.AnsiStringFixedLength, model.WeiDianId);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            model.OrderCode = this._db.GetParameterValue(cmd, "OrderCode").ToString();
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #2
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="OrderID"></param>
        /// <returns></returns>
        public int Delete(string OrderID)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_Order_Delete");

            this._db.AddInParameter(cmd, "OrderID", DbType.AnsiStringFixedLength, OrderID);
            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #3
0
        /// <summary>
        /// 设置支付状态
        /// </summary>
        /// <param name="OrderID"></param>
        /// <returns></returns>
        public int ZhiFu(MJiPiaoBaoCun model)
        {
            DbCommand cmd = _db.GetStoredProcCommand("proc_zhifu");

            this._db.AddInParameter(cmd, "memnberId", DbType.AnsiStringFixedLength, model.OpeatorID);
            this._db.AddInParameter(cmd, "orderid", DbType.AnsiStringFixedLength, model.OrderID);
            this._db.AddInParameter(cmd, "price", DbType.Decimal, model.OrderPrice);

            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #4
0
        public int SavePDF(Eyousoft_yhq.Model.Order model)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_Order_UpdatePDF");

            this._db.AddInParameter(cmd, "OrderID", DbType.AnsiStringFixedLength, model.OrderID);
            this._db.AddInParameter(cmd, "ComAttachXML", DbType.Xml, CreateComNoticeXML(model.SendFile));


            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #5
0
        /// <summary>
        /// 账户支付订单
        /// </summary>
        /// <param name="dingdan">订单</param>
        /// <param name="huiyuanbianhao">支付人</param>
        /// <returns></returns>
        public int XiaoFei(Eyousoft_yhq.Model.Order dingdan, string huiyuanbianhao)
        {
            DbCommand cmd = _db.GetStoredProcCommand("proc_XiaoFei");

            this._db.AddInParameter(cmd, "HuiYuanBianHao", DbType.AnsiStringFixedLength, huiyuanbianhao);
            this._db.AddInParameter(cmd, "DingDanBianHao", DbType.AnsiStringFixedLength, dingdan.OrderID);
            this._db.AddInParameter(cmd, "DingDanZT", DbType.Byte, dingdan.PayState);
            this._db.AddInParameter(cmd, "JinE", DbType.Decimal, dingdan.OrderPrice);
            this._db.AddOutParameter(cmd, "result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);

            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #6
0
        /// <summary>
        /// 修改订单支付状态
        /// </summary>
        /// <param name="OrderID"></param>
        /// <returns></returns>
        public int UpdatePayState(Eyousoft_yhq.Model.Order Model)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_OrderState_Update");

            this._db.AddInParameter(cmd, "OrderID", DbType.AnsiStringFixedLength, Model.OrderID);
            this._db.AddInParameter(cmd, "PayState", DbType.Byte, (int)Model.PayState);
            this._db.AddInParameter(cmd, "ConfirmCode", DbType.AnsiStringFixedLength, Model.ConfirmCode);
            this._db.AddInParameter(cmd, "OrderState", DbType.Byte, (int)Model.OrderState);
            this._db.AddInParameter(cmd, "JState", DbType.Byte, (int)Model.JIESUAN);

            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(Eyousoft_yhq.Model.Order model)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_Order_Update");

            this._db.AddInParameter(cmd, "OrderID", DbType.AnsiStringFixedLength, model.OrderID);
            this._db.AddInParameter(cmd, "OrderState", DbType.Byte, (int)model.OrderState);
            this._db.AddInParameter(cmd, "OrderPrice", DbType.Decimal, model.OrderPrice);
            this._db.AddInParameter(cmd, "Remark", DbType.String, model.Remark);



            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
Пример #8
0
        /// <summary>
        /// 产品添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(Eyousoft_yhq.Model.Product model)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("Proc_Product_Add");

            _db.AddInParameter(cmd, "ProductID", DbType.String, model.ProductID);
            _db.AddInParameter(cmd, "ProductName", DbType.String, model.ProductName);
            _db.AddInParameter(cmd, "ProductType", DbType.Int32, model.ProductType);
            _db.AddInParameter(cmd, "TourDate", DbType.DateTime, model.TourDate);
            _db.AddInParameter(cmd, "MarketPrice", DbType.Decimal, model.MarketPrice);
            _db.AddInParameter(cmd, "AppPrice", DbType.Decimal, model.AppPrice);
            _db.AddInParameter(cmd, "FavourCode", DbType.String, model.FavourCode);
            _db.AddInParameter(cmd, "LinkTel", DbType.String, model.LinkTel);
            _db.AddInParameter(cmd, "ProductDis", DbType.String, model.ProductDis);
            _db.AddInParameter(cmd, "TourDis", DbType.String, model.TourDis);
            _db.AddInParameter(cmd, "SendTourKnow", DbType.String, model.SendTourKnow);
            _db.AddInParameter(cmd, "ValidiDate", DbType.String, model.ValidiDate);
            _db.AddInParameter(cmd, "ProductState", DbType.Byte, model.ProductState);
            _db.AddInParameter(cmd, "ComAttachXML", DbType.Xml, CreateComNoticeXML(model.AttachList));
            _db.AddInParameter(cmd, "IsEveryDay", DbType.Byte, model.IsEveryDay);
            _db.AddInParameter(cmd, "IsHot", DbType.Int32, model.IsHot);
            _db.AddInParameter(cmd, "ServiceQQ", DbType.String, model.ServiceQQ);
            _db.AddInParameter(cmd, "ContractType", DbType.Byte, (int)model.ContractType);
            _db.AddInParameter(cmd, "ControlPeople", DbType.Int32, model.ControlPeople);
            _db.AddInParameter(cmd, "Scompare", DbType.String, model.Scompare);

            #region 车票 门票修改
            _db.AddInParameter(cmd, "ProductOpState", DbType.Byte, model.ProductOpState);
            _db.AddInParameter(cmd, "ProductSdate", DbType.DateTime, model.ProductSdate);
            _db.AddInParameter(cmd, "ZCodeViaDate", DbType.DateTime, model.ZCodeViaDate);
            _db.AddInParameter(cmd, "PType", DbType.Int32, model.PType);
            #endregion



            this._db.AddOutParameter(cmd, "result", DbType.Int32, 4);

            _db.AddInParameter(cmd, "FaBuRenId", DbType.AnsiStringFixedLength, model.FaBuRenId);
            _db.AddInParameter(cmd, "ShenHeStatus", DbType.Int32, model.ShenHeStatus);

            DbHelper.RunProcedureWithResult(cmd, this._db);

            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")) > 0 ? true : false);
        }