Example #1
0
        public async Task <Sohistory> PrepareUpdateWOHistory(Sohistory sohistory, WOHistoryModel model)
        {
            sohistory.Sostatus       = model.Sostatus;
            sohistory.Sodate         = model.Sodate;
            sohistory.Sogl           = model.Sogl;
            sohistory.AssetName      = model.AssetName;
            sohistory.AssetModel     = model.AssetModel;
            sohistory.AssetSerialNo  = model.AssetSerialNo;
            sohistory.Sofor          = model.Sofor;
            sohistory.Soinstructions = model.Soinstructions;
            sohistory.SopriceLabor   = model.SopriceLabor;
            sohistory.SopriceParts   = model.SopriceParts;

            sohistory = await _soRepository.UpdateAsync(sohistory);

            return(sohistory);
        }
Example #2
0
        public async Task <IActionResult> SOHistDisplayEdit(WOHistoryModel model)
        {
            var sohistory = await _workorderService.GetSOHistoryById(model.SohistoryId);

            if (sohistory == null)
            {
                return(RedirectToAction("WorkOrderHistory"));
            }

            if (ModelState.IsValid)
            {
                sohistory = await _workorderService.PrepareUpdateWOHistory(sohistory, model);

                SuccessNotification("The history data has been updated successfully.");
                return(RedirectToAction("SOHistDisplayEdit", "WorkOrders", new { SOHistoryID = sohistory.SohistoryId }));
            }

            return(View(model));
        }
Example #3
0
        public async Task <IActionResult> AddWONote(WOHistoryModel model)
        {
            if (ModelState.IsValid)
            {
                model.SohistoryDetail.LogonName   = _workContext.CurrentCustomer.UserName;
                model.SohistoryDetail.SohistoryId = model.SohistoryId;

                var soHistoryDetail = await _workorderService.InsertSoHistoryDetail(model.SohistoryDetail);

                if (soHistoryDetail == null)
                {
                    return(RedirectToAction("WorkOrderHistory"));
                }

                SuccessNotification("The note data has been save successfully.");
                return(RedirectToAction("SOHistDisplayEdit", "WorkOrders", new { SOHistoryID = soHistoryDetail.SohistoryId }));
            }

            return(RedirectToAction("SOHistDisplayEdit", "WorkOrders", new { SOHistoryID = model.SohistoryId }));
        }