public ActionResult Index(int?page = 1) { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.RequireCleaning, null); ViewBag.AccessDispatch = false; foreach (var permission in permissionList) { if (permission.PrivilegeDS == "Dispatch") { ViewBag.AccessDispatch = (permission.GrantedFL == 1); } } // database call var TANK_usp_rpt_RequiresCleaning_spParams = new TANK_usp_rpt_RequiresCleaning_spParams() { InstallID = 1, LocationID = SecurityExtended.LocationId ?? 0 }; DataTable dataTable = _utilityService.ExecStoredProcedureForDataTable("TANK_usp_rpt_RequiresCleaning", TANK_usp_rpt_RequiresCleaning_spParams); dataTable.Columns["EquipmentID"].SetOrdinal(8); //# database call @ViewBag.TotalRecords = dataTable.Rows.Count; return(View(dataTable)); }
// GET: /InvoiceList/ public ActionResult Index() { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.RequireService, null); InvoiceListModel invoiceListModel = new InvoiceListModel(); invoiceListModel.DataTableMoveHistory = new DataTable(); invoiceListModel.DataTableEquipmentInfo = new DataTable(); invoiceListModel.DataTableEquipmentProduct = new DataTable(); invoiceListModel.DataTableInvoiceHistory = new DataTable(); invoiceListModel.HfShowResult = "false"; return(View(invoiceListModel)); }
public ActionResult Prep(string equipmentAn) { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.PrepScreen, null); ViewBag.AllowDelete = false; foreach (var permission in permissionList) { if (permission.PrivilegeDS == "Delete Dispatch") { ViewBag.AllowDelete = (permission.GrantedFL == 1); } } LoadTankPrepDropdowns(); ViewBag.EquipmentAN = equipmentAn; var viewModel = new TankPrepPostModel(); return(View(viewModel)); }
// GET: Dispatch public ActionResult Index(string equipmentAn, int?dispatchId, string mode) { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.DispatchScreen, null); ViewBag.AllowDeleteDispatch = false; ViewBag.AllowAddProduct = false; ViewBag.AllowAddInvoice = false; foreach (var permission in permissionList) { if (permission.PrivilegeDS == "Delete Dispatch") { ViewBag.AllowDeleteDispatch = (permission.GrantedFL == 1); } else if (permission.PrivilegeDS == "Add Product") { ViewBag.AllowAddProduct = (permission.GrantedFL == 1); } else if (permission.PrivilegeDS == "Add Invoice") { ViewBag.AllowAddInvoice = (permission.GrantedFL == 1); } } LoadDispatchTankDropdowns(); TempData["EquipmentAN"] = ViewBag.EquipmentAN = equipmentAn; var postModel = new DispatchTankModel(); postModel.intDispatchId = dispatchId; if (dispatchId.HasValue) { LoadDispatch(dispatchId.Value, postModel); } return(View(postModel)); }
// GET: /TankHistory/ public ActionResult Index(string tankNumber) { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.TankHistory, null); ViewBag.AllowDispatch = true; ViewBag.AllowPrep = true; ViewBag.AllowEditDispatch = true; ViewBag.AllowViewOnHireHistory = true; ViewBag.AllowEditOnHireHistory = true; ViewBag.AllowEditTankInfo = true; //foreach (var permission in permissionList) //{ // if (permission.PrivilegeDS == "Dispatch") // { // ViewBag.AllowDispatch = (permission.GrantedFL == 1); // } // else if (permission.PrivilegeDS == "Prep") // { // ViewBag.AllowPrep = (permission.GrantedFL == 1); // } // else if (permission.PrivilegeDS == "Edit Dispatch") // { // ViewBag.AllowEditDispatch = (permission.GrantedFL == 1); // } // else if (permission.PrivilegeDS == "View On Hire History") // { // ViewBag.AllowViewOnHireHistory = (permission.GrantedFL == 1); // } // else if (permission.PrivilegeDS == "Edit On Hire History") // { // ViewBag.AllowEditOnHireHistory = (permission.GrantedFL == 1); // } // else if (permission.PrivilegeDS == "Edit Tank Info") // { // ViewBag.AllowEditTankInfo = (permission.GrantedFL == 1); // } //} TankHistoryModel tankHistoryModel = new TankHistoryModel(); string equipment = string.Empty; if (!string.IsNullOrEmpty(tankNumber)) { equipment = tankNumber.TrimEnd(); } if (TempData["Equipment"] != null) { equipment = TempData["Equipment"].ToString(); } int locationId = SecurityExtended.LocationId.Value; int majorLocationID = SecurityExtended.LocationId.Value; tankHistoryModel.DataTableActivityHistory = GetTankActivityHistory(false, locationId, equipment, ""); tankHistoryModel.DataTableActivityHistory.Columns["DispatchID"].SetOrdinal(15); tankHistoryModel.DataTableEquipmentInfo = GetEquipmentInfo(false, majorLocationID, equipment); tankHistoryModel.DataTableEquipmentInfo.Columns["EquipmentID"].SetOrdinal(44); tankHistoryModel.DataTableEquipmentProduct = GetEquipmentProduct(false, equipment); tankHistoryModel.DataTableOnHireHistory = GetOnHireHistory(false, locationId, equipment); tankHistoryModel.HfShowResult = !string.IsNullOrEmpty(equipment) ? "true" : "false"; tankHistoryModel.TextSearch = equipment; return(View(tankHistoryModel)); }
// // GET: /TankSearch/ public ActionResult Index() { PopulateSecurityExtended(); int securityProfileId = SecurityExtended.SecurityProfileId; var permissionList = _sharedFunctions.GetSecuritySettings(securityProfileId, (int)SecurityCatEnum.TankSearch, null); ViewBag.AccessDispatch = false; ViewBag.AllowPrep = false; foreach (var permission in permissionList) { if (permission.PrivilegeDS == "Dispatch") { ViewBag.AccessDispatch = (permission.GrantedFL == 1); } else if (permission.PrivilegeDS == "Prep") { ViewBag.AllowPrep = (permission.GrantedFL == 1); } } LoadTankSearchDropdowns(); TankSearchPostModel postModel; var dataTable = new DataTable(); var TANK_usp_rpt_TankSearch_spParams = new TANK_usp_rpt_TankSearch_spParams(); if (TempData["postModel"] != null) { postModel = (TankSearchPostModel)TempData["postModel"]; TANK_usp_rpt_TankSearch_spParams.LocationID = SecurityExtended.LocationId.Value; if (postModel.TankNumber != null && postModel.TankNumber.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.EquipmentAN = postModel.TankNumber; } if (postModel.Chassis != null && postModel.Chassis.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ChassisEquipmentAN = postModel.Chassis; } if (postModel.Product != null && postModel.Product.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ProductDS = postModel.Product.Trim().Replace("%", "[%]"); } if (postModel.LoadStatus != null && postModel.LoadStatus.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.LoadStatusTypeCD = postModel.LoadStatus; } if (postModel.LocationFromCode != null && postModel.LocationFromCode > 0) { TANK_usp_rpt_TankSearch_spParams.FromSubLocationID = postModel.LocationFromCode; TANK_usp_rpt_TankSearch_spParams.FromSubLocationDS = ""; } if (postModel.LocationToCode != null && postModel.LocationToCode > 0) { TANK_usp_rpt_TankSearch_spParams.SubLocationID = postModel.LocationToCode; TANK_usp_rpt_TankSearch_spParams.SubLocationDS = ""; } if (postModel.ChargeNbr != null && postModel.ChargeNbr.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ChargeCodeAN = postModel.ChargeNbr; } if (postModel.ShipmentNbr != null && postModel.ShipmentNbr.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ShipmentAN = postModel.ShipmentNbr; } if (postModel.ChargeBlockOnHire != null && postModel.ChargeBlockOnHire.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ChargeBlockLocationAN = postModel.ChargeBlockOnHire; } if (postModel.ServiceType != null && postModel.ServiceType.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.ServiceTypeDS = postModel.ServiceType; } if (postModel.DedicatedProduct != null && postModel.DedicatedProduct.Trim().Length > 0) { TANK_usp_rpt_TankSearch_spParams.DedicatedProductDS = postModel.DedicatedProduct; } if (postModel.DispatchReason != null && postModel.DispatchReason != null) { TANK_usp_rpt_TankSearch_spParams.DispatchReasonTypeCD = postModel.DispatchReason; } if (postModel.chkLastMove != null && postModel.chkLastMove) { TANK_usp_rpt_TankSearch_spParams.SearchLastMoveOnlyFL = postModel.chkLastMove; } // database call dataTable = _utilityService.ExecStoredProcedureForDataTable("TANK_usp_rpt_TankSearch", TANK_usp_rpt_TankSearch_spParams); //# database call } @ViewBag.TotalRecords = dataTable.Rows.Count; return(View(dataTable)); }