Exemple #1
0
        /// <summary>
        ///  用户预约车辆试驾信息
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="carid"></param>
        /// <returns></returns>
        public JsonResult Reservation(string userid, string carid)
        {
            ReservationsEntity entity = new ReservationsEntity();

            entity.CustomerID = Convert.ToInt64(userid);
            entity.CarID      = Convert.ToInt32(carid);
            entity.RType      = "SJ"; //SJ:销售试驾 2:ZL:租车预约 DZ:电桩预约
            entity.Status     = 0;    //0未处理 1:已处理
            bool result = ReservationsService.AddReservations(entity);
            ApiReservationsEntity apiE = new ApiReservationsEntity();

            if (result)
            {
                apiE.code     = "200";
                apiE.codeinfo = "汽车试驾预约成功!稍后客服联系您!";
            }
            else
            {
                apiE.code     = "201";
                apiE.codeinfo = "预约失败,请稍后再试!";
            }
            return(Json(JsonHelper.ToJson(apiE)));
        }