namespace VECV_WebApi.Controllers.Van
{
#region Namespaces
using LoggingHelper;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using VECV_WebApi.Models.Van;
#endregion
///
/// This controller contain apis releted to van
///
public class VanPositionController : ApiController
{
#region Global Variable
///
/// making object of LoggingUtility class available to this class
///
LoggingUtility objLog = new LoggingUtility();
///
/// making the data-log file path available to this class
///
string path = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PathLog"]);
///
/// making data log file path available to this class
///
string logtf = (ConfigurationManager.AppSettings["Log"]);
///
/// making error log file path available to this class
///
string errorlogtf = (ConfigurationManager.AppSettings["ErrorLog"]);
///
/// making the Database connection string available to this class
///
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
#endregion
#region APIs
///
/// To set/remove alarm for van not move or van not live
///
/// van info
/// status and data
public GetVanPositionModel Post(GetVanPositionModel model)
{
GetVanPositionModel objModel =new GetVanPositionModel();
try
{
VanRepository objVanRepository = new VanRepository(_connStr);
// van not move after accept ticket.
objModel=objVanRepository.VanNotMoveAfterAcceptTicket(model);
// write data log into file
// van not live
objModel = objVanRepository.VanNotLive(model);
// write data log into file
}
catch (Exception Ex)
{
// write error log into file
objLog.ErrorLogFile("VanPositionController post method no parameter", Ex.Message, path, errorlogtf);
objModel.Status = "0";
objModel.Message = Ex.Message;
}
return objModel;
}
#endregion
}
}