119 lines
3.9 KiB
C#
119 lines
3.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web.Http;
|
|
|
|
namespace VECV_WebApi.Controllers.Ticket
|
|
{
|
|
#region Namespaces
|
|
|
|
using LoggingHelper;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using VECV_WebApi.Models.Customer;
|
|
using VECV_WebApi.Models.EmailServices;
|
|
using VECV_WebApi.Models.Ticket;
|
|
using VECV_WebApi.Models.Vehicle;
|
|
|
|
|
|
#endregion
|
|
public class DraftTicketController : ApiController
|
|
{
|
|
#region Global Variable
|
|
|
|
/// <summary>
|
|
/// making object of LoggingUtility class available to this class
|
|
/// </summary>
|
|
LoggingUtility objLog = new LoggingUtility();
|
|
|
|
/// <summary>
|
|
/// making the data-log file path available to this class
|
|
/// </summary>
|
|
string path = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PathLog"]);
|
|
|
|
/// <summary>
|
|
/// making data log file path available to this class
|
|
/// </summary>
|
|
string logtf = (ConfigurationManager.AppSettings["Log"]);
|
|
|
|
/// <summary>
|
|
/// making error log file path available to this class
|
|
/// </summary>
|
|
string errorlogtf = (ConfigurationManager.AppSettings["ErrorLog"]);
|
|
|
|
string _appName = (ConfigurationManager.AppSettings["ApplicationName"]);
|
|
|
|
/// <summary>
|
|
/// making the Database connection string available to this class
|
|
/// </summary>
|
|
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
|
|
|
|
/// <summary>
|
|
/// making Global Repository object available to this class
|
|
/// </summary>
|
|
// GlobalRepository objGlobalRepository;
|
|
|
|
/// <summary>
|
|
/// making Customer Repository object available to this class
|
|
/// </summary>
|
|
// CustomerRepository objCustomerRepository;
|
|
|
|
/// <summary>
|
|
/// making Ticket Repository object available to this class
|
|
/// </summary>
|
|
TicketRepository objTicketRepository;
|
|
|
|
|
|
#endregion
|
|
public List<DummyOpenTicketDetail> Post([FromUri] string DummyTicketDetails, [FromBody] DummyOpenTicketDetail model)
|
|
{
|
|
List<DummyOpenTicketDetail> objList = new List<DummyOpenTicketDetail>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
if (model.VehicleRegisterNumber != null && model.VehicleRegisterNumber != "")
|
|
{
|
|
//replace "-" to blank space and than replace blank space to empty string in registration no.
|
|
model.VehicleRegisterNumber = model.VehicleRegisterNumber.Replace("-", " ").Replace(" ", String.Empty);
|
|
}
|
|
objList = objTicketRepository.GetDummyTicketDetails(model);
|
|
return objList;
|
|
|
|
|
|
}
|
|
|
|
|
|
public string Post([FromUri] string getDummyId, [FromUri] string RegistrationNumber)
|
|
{
|
|
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
if (RegistrationNumber != null && RegistrationNumber != "")
|
|
{
|
|
//replace "-" to blank space and than replace blank space to empty string in registration no.
|
|
RegistrationNumber = RegistrationNumber.Replace("-", " ").Replace(" ", String.Empty);
|
|
}
|
|
string strsucess = objTicketRepository.GetDummyTicketByTicketId(RegistrationNumber);
|
|
return strsucess;
|
|
|
|
|
|
}
|
|
public string Get([FromUri] string modelno)
|
|
{
|
|
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
|
|
string strsucess = objTicketRepository.GetVehicleTypeByModelNumber(modelno);
|
|
return strsucess;
|
|
|
|
// return vehicletype;
|
|
}
|
|
}
|
|
}
|