Example #1
0
        /// <summary>
        /// 添加订单
        /// </summary>
        /// <param name="en">订单信息</param>
        /// <returns></returns>
        public int add(OrderInfo en)
        {
            string strSql = "insert into OrderInfo (contractID, orderID, costTargetID, roomNum, begintime, endtime, memo, makeTargetID, playReport, reportTime, mdate) "
                + "values (@contractID, @orderID, @costTargetID, @roomNum, @begintime, @endtime, @memo, @makeTargetID, @playReport, @reportTime, @mdate)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@contractID", en.contractID),
                new SqlParameter("@orderID", en.orderID),
                new SqlParameter("@costTargetID", en.costTargetID),
                new SqlParameter("@roomNum", en.roomNum),
                new SqlParameter("@begintime", en.begintime),
                new SqlParameter("@endtime", en.endtime),
                new SqlParameter("@memo", en.memo),
                new SqlParameter("@makeTargetID", en.makeTargetID),
                new SqlParameter("@playReport", System.DBNull.Value),
                new SqlParameter("@reportTime", System.DBNull.Value),
                new SqlParameter("@mdate", DateTime.Now)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
Example #2
0
        /// <summary>
        /// 修改订单
        /// </summary>
        /// <param name="en">订单信息</param>
        /// <returns></returns>
        public int update(OrderInfo en)
        {
            string strSql = "update OrderInfo set orderID=@orderID, costTargetID=@costTargetID, makeTargetID=@makeTargetID, roomNum=@roomNum, begintime=@begintime, endtime=@endtime, memo=@memo where id=@id ";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@orderID", en.orderID),
                new SqlParameter("@costTargetID", en.costTargetID),
                new SqlParameter("@makeTargetID", en.makeTargetID),
                new SqlParameter("@roomNum", en.roomNum),
                new SqlParameter("@begintime", en.begintime),
                new SqlParameter("@endtime", en.endtime),
                new SqlParameter("@memo", en.memo),
                new SqlParameter("@id", en.id)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
Example #3
0
        public JsonResult Order_edit(string id, string orderID, string adCost, string makeCost, string num, string begin, string end, string memo)
        {
            if (num.Trim() == "")
                num = "0";

            OrderInfo en = new OrderInfo();
            en.id = Convert.ToInt32(id);
            en.orderID = orderID;
            en.costTargetID = Convert.ToInt32(adCost);
            en.makeTargetID = Convert.ToInt32(makeCost);
            en.roomNum = Convert.ToInt32(num);
            en.begintime = Convert.ToDateTime(begin);
            en.endtime = Convert.ToDateTime(end);
            en.memo = memo;

            DaOrderInfo dal = new DaOrderInfo();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }