public ActionResult CreateRepairLineItems(string serviceOrderNo, string serialNumberList, string conditionId, string symptomAreaId, string symptomCodeId, string diagnosisAreaId, string diagnosisCodeId, string resolutionId, string repairStageId, string technicianNo, string description, string serviceComments) { string userName = null; bool isSuccess = false; try { userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairType = new RepairType(); isSuccess = repairType.CreateRepairLineItems(serviceOrderNo, serialNumberList, conditionId, symptomAreaId, symptomCodeId, diagnosisAreaId, diagnosisCodeId, resolutionId, repairStageId, technicianNo, description, serviceComments, userName); if (isSuccess) { TempData["ServiceOrderId"] = serviceOrderNo; Session["SID"] = serviceOrderNo; } ViewData["RepairLinesList"] = GetRepairLinesDetails(TempData["ServiceOrderId"].ToString()); TempData["RepairLinesList"] = ViewData["RepairLinesList"]; TempData.Keep(); } catch (Exception ex) { TempData.Keep(); throw ex; } return View("RepairLineDetails"); }
public List <RepairType> GetRepairStages(string userName) { IAXHelper axHelper = ObjectFactory.GetInstance <IAXHelper>(); List <RepairType> repairList = new List <RepairType>(); try { DataTable resultTable = axHelper.GetRespairStageList(userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.RepairStageId = row["RepairStageId"].ToString(); repairObject.RepairStageName = row["Name"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return(repairList); }
public IQueryable <RepairType> GetDiagnosisCode(string diagnosisArea, string userName) { IAXHelper axHelper = ObjectFactory.GetInstance <IAXHelper>(); List <RepairType> repairList = new List <RepairType>(); try { DataTable resultTable = axHelper.GetDiagnosisCodeList(diagnosisArea, userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.DiagonsisCodeId = row["DiagnosisCodeId"].ToString(); repairObject.DiagonsisCodeName = row["Name"].ToString(); repairObject.DiagonsisAreaId = row["DiagnosisAreaId"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return(repairList.AsQueryable <RepairType>()); }
public List <RepairType> GetRepairLineDetails(string serviceorderId, string userName) { IAXHelper axHelper = ObjectFactory.GetInstance <IAXHelper>(); List <RepairType> repairList = new List <RepairType>(); try { DataTable resultTable = axHelper.GetRepairLines(serviceorderId, userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.RepServiceOrder = row["RepServiceOrder"].ToString(); repairObject.UniqueId = row["UniqueId"].ToString(); repairObject.ServiceObjectRelation = row["SORelationID"].ToString(); repairObject.Description = row["Description"].ToString(); repairObject.ConditionId = row["ConditionId"].ToString(); repairObject.SymptomAreaId = row["SymptomAreaId"].ToString(); repairObject.SymptomCodeId = row["SymptomCodeId"].ToString(); repairObject.DiagonsisAreaId = row["DiagnosisAreaId"].ToString(); repairObject.DiagonsisCodeId = row["DiagnosisCodeId"].ToString(); repairObject.ResolutionId = row["ResolutionId"].ToString(); repairObject.RepairStageId = row["RepairStageId"].ToString(); repairObject.ServiceTechnicianNo = row["TechnicianNo"].ToString(); repairObject.ServiceTechnicianName = row["TechnicianName"].ToString(); //repairObject.Technician = new Models.ServiceTechnician(row["TechnicianName"].ToString(), row["TechnicianNo"].ToString()); repairObject.Comments = row["ServiceComments"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return(repairList); }
public ActionResult DeleteRepairLine(string uniqueID) { string userName = null; bool isSuccess = false; try { userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairType = new RepairType(); isSuccess = repairType.DeleteRepairLineItems(uniqueID, userName); TempData["ServiceOrderId"] = Session["SID"].ToString(); ViewData["RepairLinesList"] = GetRepairLinesDetails(TempData["ServiceOrderId"].ToString()); TempData.Keep(); } catch (Exception ex) { TempData.Keep(); ExceptionLog.LogException(ex, userName); } return View(new GridModel<RepairType> { Data = ViewData["RepairLinesList"] as List<RepairType> }); }
public IQueryable<RepairType> GetSymptomCode(string symptomArea, string userName) { IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>(); List<RepairType> repairList = new List<RepairType>(); try { DataTable resultTable = axHelper.GetSymptomCodeList(symptomArea, userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.SymptomCodeId = row["SMASymptomCodeId"].ToString(); repairObject.SymptomCodeName = row["Name"].ToString(); repairObject.SymptomAreaId = row["SMASymptomAreaId"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return repairList.AsQueryable<RepairType>(); }
public List<RepairType> GetResolution(string userName) { IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>(); List<RepairType> repairList = new List<RepairType>(); try { DataTable resultTable = axHelper.GetResolutionList(userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.ResolutionId = row["ResolutionId"].ToString(); repairObject.ResolutionName = row["Name"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return repairList; }
public List<RepairType> GetRepairLineDetails(string serviceorderId, string userName) { IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>(); List<RepairType> repairList = new List<RepairType>(); try { DataTable resultTable = axHelper.GetRepairLines(serviceorderId, userName); foreach (DataRow row in resultTable.Rows) { RepairType repairObject = new RepairType(); repairObject.RepServiceOrder = row["RepServiceOrder"].ToString(); repairObject.UniqueId = row["UniqueId"].ToString(); repairObject.ServiceObjectRelation = row["SORelationID"].ToString(); repairObject.Description = row["Description"].ToString(); repairObject.ConditionId = row["ConditionId"].ToString(); repairObject.SymptomAreaId = row["SymptomAreaId"].ToString(); repairObject.SymptomCodeId = row["SymptomCodeId"].ToString(); repairObject.DiagonsisAreaId = row["DiagnosisAreaId"].ToString(); repairObject.DiagonsisCodeId = row["DiagnosisCodeId"].ToString(); repairObject.ResolutionId = row["ResolutionId"].ToString(); repairObject.RepairStageId = row["RepairStageId"].ToString(); repairObject.ServiceTechnicianNo = row["TechnicianNo"].ToString(); repairObject.ServiceTechnicianName = row["TechnicianName"].ToString(); //repairObject.Technician = new Models.ServiceTechnician(row["TechnicianName"].ToString(), row["TechnicianNo"].ToString()); repairObject.Comments = row["ServiceComments"].ToString(); repairList.Add(repairObject); } } catch (Exception e) { throw e; } return repairList; }
private JsonResult _GetSymptomCodeval(string SymptomAreaId) { string userName = User.Identity.Name.ToString().Split('\\')[1]; RepairType repairTypeObj = new RepairType(); return Json(new SelectList(repairTypeObj.GetSymptomCode(SymptomAreaId, userName), "SymptomCodeId", "SymptomCodeName"), JsonRequestBehavior.AllowGet); }
// // GET: /RepairLines/ public ActionResult RepairLines() { TempData["ServiceOrderId"] = Session["SID"]; TempData["RepairSiteId"]=Session["SiteID"]; RepairType repairTypeObj = new RepairType(); string userName = User.Identity.Name.ToString().Split('\\')[1]; try { if (HttpContext.Session != null) { if (Session["SiteID"] == null) { return RedirectToAction("ServiceOrderWithHistory", "WorkOrder"); } } if (TempData["ServiceOrderId"] != null) { ServiceOrderLine serviceOrderLineobj = new ServiceOrderLine(); repairTypeObj.ServiceOrderLine = serviceOrderLineobj; SerivceOrderPartLine serviceOrderPartLineObj = new SerivceOrderPartLine(); IEnumerable<SerivceOrderPartLine> serviceOrderPartLineCollection = null; serviceOrderPartLineCollection = serviceOrderPartLineObj.GetSerialNumberByServiceOrder(TempData["ServiceOrderId"].ToString(), userName); serviceOrderPartLineObj.ServiceOrderPartLineList = new SelectList(serviceOrderPartLineCollection, "SerialNumber", "SerialNumber", null); ViewData["SerialNumberList"] = serviceOrderPartLineObj.ServiceOrderPartLineList; repairTypeObj.ConditionList = new SelectList(repairTypeObj.GetCondtions(userName), "ConditionId", "ConditionName", null); ViewData["Condition"] = repairTypeObj.ConditionList; repairTypeObj.SysmptomAreaList = new SelectList(repairTypeObj.GetSymptomArea(userName), "SymptomAreaId", "SymptomAreaName", null); ViewData["SymptomArea"] = repairTypeObj.SysmptomAreaList; repairTypeObj.DiagnosisAreaList = new SelectList(repairTypeObj.GetDiagnosisArea(userName), "DiagonsisAreaId", "DiagonsisAreaName", null); ViewData["DiagnosisArea"] = repairTypeObj.DiagnosisAreaList; repairTypeObj.ResolutionList = new SelectList(repairTypeObj.GetResolution(userName), "ResolutionId", "ResolutionName", null); ViewData["Resolution"] = repairTypeObj.ResolutionList; repairTypeObj.RepairStageList = new SelectList(repairTypeObj.GetRepairStages(userName), "RepairStageId", "RepairStageName", null); ViewData["RepairStage"] = repairTypeObj.RepairStageList; //ServiceTechnician serviceTechnician = new ServiceTechnician(); //serviceTechnician.ServiceTechnicianList = new SelectList(serviceTechnician.GetTechnicians(userName), "ServiceTechnicianNo", "ServiceTechnicianName", null); //ViewData["ServiceTechnicianList"] = serviceTechnician.ServiceTechnicianList; ServiceOrder ServiceOrder = new ServiceOrder(); ServiceOrder.ServiceOrderList = GetServiceOrderDetailsByServiceOrder(TempData["RepairSiteId"].ToString(), TempData["ServiceOrderId"].ToString()); repairTypeObj.ServiceOrders = ServiceOrder; ViewData["ServiceOrderDetailsinRepairLines"] = repairTypeObj.ServiceOrders.ServiceOrderList; ServiceTechnician serviceTechnician = new ServiceTechnician(); IEnumerable<ServiceTechnician> serviceTechnicianCollection = null; serviceTechnicianCollection = serviceTechnician.GetTechnicians(userName); if (!String.IsNullOrEmpty(TempData["Technician-No"].ToString())) { serviceTechnician.ServiceTechnicianList = new SelectList(serviceTechnicianCollection, "ServiceTechnicianNo", "ServiceTechnicianName", serviceTechnicianCollection.First<ServiceTechnician>().ServiceTechnicianNo = TempData["Technician-No"].ToString()); } else { serviceTechnician.ServiceTechnicianList = new SelectList(serviceTechnicianCollection, "ServiceTechnicianNo", "ServiceTechnicianName", null); } ViewData["ServiceTechnicianList"] = serviceTechnician.ServiceTechnicianList; //List<RepairType> RepairLineList = (new RepairType()).GetRepairLineDetails(TempData["ServiceOrderId"].ToString(), userName); //repairTypeObj.RepairLineList = new SelectList(repairTypeObj.GetRepairLineDetails(TempData["ServiceOrderId"].ToString(), userName)); //ViewData["RepairLinesList"] = GetRepairLinesDetails(TempData["ServiceOrderId"].ToString()); TempData.Keep(); } else { return RedirectToAction("ServiceOrderWithHistory","WorkOrder"); } } catch (Exception ex) { TempData.Keep(); ExceptionLog.LogException(ex, userName); } return View(repairTypeObj); }