Beispiel #1
0
        public ActionResult AddServiceCallDetailSpare(bool update)
        {
            ServiceCallDetailViewModel serviceCallDetailVM = new ServiceCallDetailViewModel();

            serviceCallDetailVM.IsUpdate = update;
            return(PartialView("_AddServiceCallDetailSpare", serviceCallDetailVM));
        }
Beispiel #2
0
 public string GetServiceCallDetailListByServiceCallID(Guid serviceCallID)
 {
     try
     {
         List <ServiceCallDetailViewModel> serviceCallItemViewModelList = new List <ServiceCallDetailViewModel>();
         if (serviceCallID == Guid.Empty)
         {
             ServiceCallDetailViewModel serviceCallDetailVM = new ServiceCallDetailViewModel()
             {
                 ID                = Guid.Empty,
                 ServiceCallID     = Guid.Empty,
                 ProductID         = Guid.Empty,
                 ProductModelID    = Guid.Empty,
                 ProductSpec       = string.Empty,
                 GuaranteeYN       = null,
                 ServiceStatusCode = null,
                 InstalledDate     = null,
                 SpareID           = Guid.Empty,
                 Product           = new ProductViewModel()
                 {
                     ID   = Guid.Empty,
                     Code = string.Empty,
                     Name = string.Empty,
                 },
                 ProductModel = new ProductModelViewModel()
                 {
                     ID   = Guid.Empty,
                     Name = string.Empty
                 },
                 Spare = new SpareViewModel()
                 {
                     ID   = Guid.Empty,
                     Code = string.Empty,
                     Name = string.Empty,
                 },
             };
             serviceCallItemViewModelList.Add(serviceCallDetailVM);
         }
         else
         {
             serviceCallItemViewModelList = Mapper.Map <List <ServiceCallDetail>, List <ServiceCallDetailViewModel> >(_serviceCallBusiness.GetServiceCallDetailListByServiceCallID(serviceCallID));
         }
         return(JsonConvert.SerializeObject(new { Status = "OK", Records = serviceCallItemViewModelList, Message = "Success" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConstant.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Records = "", Message = cm.Message }));
     }
 }