예제 #1
0
        /// <summary>
        /// 确认订单变更
        /// </summary>
        /// <param name="id">变更编号</param>
        /// <param name="surePersonId">确认人编号</param>
        /// <param name="surePerson">确认人</param>
        /// <returns></returns>
        public int UpdateTourOrderChange(string id, string surePersonId, string surePerson)
        {
            DbCommand cmd = _db.GetStoredProcCommand("proc_TourOrderChange_Update");

            _db.AddInParameter(cmd, "Id", DbType.AnsiStringFixedLength, id);
            _db.AddInParameter(cmd, "SurePersonId", DbType.AnsiStringFixedLength, surePersonId);
            _db.AddInParameter(cmd, "SurePerson", DbType.String, surePerson);
            _db.AddOutParameter(cmd, "Result", DbType.Int32, 4);
            DbHelper.RunProcedureWithResult(cmd, _db);
            return(Convert.ToInt32(_db.GetParameterValue(cmd, "Result")));
        }
예제 #2
0
        public static void buildParameter(Microsoft.Practices.EnterpriseLibrary.Data.Database db, DbCommand dbCommand, string name, object value)
        {
            DbParameter p = dbCommand.CreateParameter();

            p.Value = value;
            db.AddInParameter(dbCommand, name, p.DbType, value);
        }
예제 #3
0
        public override decimal GetTaxRate(string zip)
        {
            decimal dOut = 0;

            //load the default db from the base class
            Microsoft.Practices.EnterpriseLibrary.Data.Database db = Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase();
            //specify the SP
            string cmd = "CSK_Tax_GetTaxRate";

            using (DbCommand dbCommand = db.GetStoredProcCommand(cmd)) {
                db.AddInParameter(dbCommand, "@zip", DbType.String, zip);
                //return a reader using the Ent Blocks
                using (IDataReader rdr = db.ExecuteReader(dbCommand)) {
                    if (rdr.Read())
                    {
                        dOut = (decimal)rdr["rate"];
                    }
                }
                //load routine closes the reader if flag is set to true;
                return(dOut);
            }
        }
예제 #4
0
        /// <summary>
        /// 选中页码上传图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtYM.Text.Trim()))
            {
                MessageBox.Show("页码不能为空!");
                return;
            }
            //创建一个对话框对象
            OpenFileDialog ofd = new OpenFileDialog();

            //为对话框设置标题
            ofd.Title = "请选择上传的图片";
            //设置筛选的图片格式
            ofd.Filter = "图片格式|*.jpg";
            //设置是否允许多选
            ofd.Multiselect = false;
            //如果你点了“确定”按钮
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //获得文件的完整路径(包括名字后后缀)
                string filePath = ofd.FileName;
                int    position = filePath.LastIndexOf("\\");
                //从完整路径中截取出来文件名“1.jpg”
                string fileName = filePath.Substring(position + 1);
                Byte[] bytes    = GetContent(filePath);

                MemoryStream ms = new MemoryStream(bytes);

                //测点信息表上传图片
                string    strMeasPageID  = GetMeasPageID(comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), txtYM.Text.Trim());
                string    strSqlMeasPage = " update MeasurementPages set MeasPageImage=@Picture " + " where MeasPageID=" + strMeasPageID;
                DbCommand dbc            = db.GetSqlStringCommand(strSqlMeasPage);
                db.AddInParameter(dbc, "@Picture", DbType.AnsiString, bytes);
                int ipa = db.ExecuteNonQuery(dbc);
                this.pictureBox1.Image = Image.FromStream(ms);
            }
        }
예제 #5
0
        //操作中——销售未派计划
        //已落实——计调配置完毕

        /// <summary>
        ///1:添加成功
        ///0:添加失败
        /// </summary>
        /// <param name="single">单项业务的实体</param>
        /// <returns></returns>
        public int AddSingleService(MSingleServiceExtend single)
        {
            string tourId = string.IsNullOrEmpty(single.TourId) ? Guid.NewGuid().ToString() : single.TourId;

            string OrderId = string.IsNullOrEmpty(single.OrderId) ? Guid.NewGuid().ToString() : single.OrderId;

            string travellerXML = string.Empty;//游客信息

            if (single.TourOrderTravellerList != null)
            {
                travellerXML = CreateTourOrderTravellerXml(single.TourOrderTravellerList, OrderId);//游客信息
            }

            string teamPriceXMl = string.Empty;//客人要求(分项报价)

            if (single.TourTeamPriceList != null)
            {
                teamPriceXMl = CreateTourTeamPriceXml(tourId, single.TourTeamPriceList);
            }

            string planXML = string.Empty;//供应商安排

            if (single.PlanBaseInfoList != null)
            {
                planXML = CreatePlanBaseInfoXml(tourId, single.CompanyId, single.OperatorDeptId, single.PlanBaseInfoList);
            }
            string planerXML = string.Empty;//计调员信息

            if (single.TourPlanersList != null)
            {
                planerXML = CreateTourPlanerXML(tourId, single.TourPlanersList);
            }

            DbCommand cmd = _db.GetStoredProcCommand("proc_TourOrder_Add_SingleService");

            _db.AddInParameter(cmd, "TourId", DbType.AnsiStringFixedLength, tourId);
            _db.AddInParameter(cmd, "TourCode", DbType.String, single.TourCode);
            _db.AddInParameter(cmd, "OrderId", DbType.AnsiStringFixedLength, OrderId);
            _db.AddInParameter(cmd, "OrderCode", DbType.String, single.OrderCode);
            _db.AddInParameter(cmd, "CompanyId", DbType.AnsiStringFixedLength, single.CompanyId);
            _db.AddInParameter(cmd, "BuyCompanyName", DbType.String, single.BuyCompanyName);
            _db.AddInParameter(cmd, "BuyCompanyId", DbType.AnsiStringFixedLength, single.BuyCompanyId);
            _db.AddInParameter(cmd, "ContactDepartId", DbType.String, single.ContactDepartId);
            _db.AddInParameter(cmd, "ContactName", DbType.String, single.ContactName);
            _db.AddInParameter(cmd, "ContactTel", DbType.String, single.ContactTel);
            _db.AddInParameter(cmd, "Adults", DbType.Int32, single.Adults);
            _db.AddInParameter(cmd, "SellerId", DbType.AnsiStringFixedLength, single.SellerId);
            _db.AddInParameter(cmd, "SellerName", DbType.String, single.SellerName);
            _db.AddInParameter(cmd, "DeptId", DbType.String, single.DeptId);//销售员部门编号
            _db.AddInParameter(cmd, "OperatorId", DbType.AnsiStringFixedLength, single.OperatorId);
            _db.AddInParameter(cmd, "Operator", DbType.String, single.Operator);
            _db.AddInParameter(cmd, "TourIncome", DbType.Currency, single.TourIncome);
            _db.AddInParameter(cmd, "TourPay", DbType.Currency, single.TourPay);//合计支出
            _db.AddInParameter(cmd, "TourProfit", DbType.Currency, single.TourProfit);
            _db.AddInParameter(cmd, "TravellerFile", DbType.String, single.TravellerFile);
            _db.AddInParameter(cmd, "TourStatus", DbType.Byte, (int)single.TourStatus);//计划状态
            _db.AddInParameter(cmd, "MTourOrderTraveller", DbType.String, travellerXML);
            _db.AddInParameter(cmd, "MTourTeamPrice", DbType.String, teamPriceXMl);
            _db.AddInParameter(cmd, "MPlanBaseInfo", DbType.String, planXML);
            _db.AddInParameter(cmd, "MTourPlaner", DbType.String, planerXML);
            _db.AddOutParameter(cmd, "Result", DbType.Int32, 4);
            _db.AddInParameter(cmd, "WeiTuoRiQi", DbType.DateTime, single.WeiTuoRiQi);
            _db.AddInParameter(cmd, "HeTongId", DbType.AnsiStringFixedLength, single.HeTongId);
            _db.AddInParameter(cmd, "XuHao", DbType.Int32, single.XuHao);

            DbHelper.RunProcedureWithResult(cmd, _db);

            return(Utils.GetInt(_db.GetParameterValue(cmd, "Result").ToString(), 4));
        }
예제 #6
0
 /// <summary>
 /// Adds a parameter and value to a DBCommand
 /// </summary>
 /// <param name="com"></param>
 /// <param name="name"></param>
 /// <param name="dbType"></param>
 /// <param name="value"></param>
 public void AddCommandParameter(DbCommand com, string name, DbType dbType, object value)
 {
     Db.AddInParameter(com, name, dbType, value);
 }