/// <summary>
        /// Create Internal Incident and FSAR_VIN records Function
        /// </summary>
        private void CreateRecords()
        {
            //To not allow build event to add multiple VINs in case of warranty workorder type
            //if VIN records already exist.
            if (_woCatLabel == "Warranty")
            {
                string[] response = RightNowConnectService.GetService().GetAffectedBus(_incidentRecord.ID);
                if (response != null)
                {
                    _affectedBusIds = response.ToList();
                }


                if (_affectedBusIds.Count > 0)
                {
                    form.Hide();
                    MessageBox.Show("For Warranty Work Order Category Multiple VINs cannot be added.");
                }
                else
                {
                    CompleteBuildProcess();
                }
            }
            else
            {
                CompleteBuildProcess();
            }
        }
예제 #2
0
        /// <summary>
        /// Method which is called when any Workspace Rule Action is invoked.
        /// </summary>
        /// <param name="ActionName">The name of the Workspace Rule Action that was invoked.</param>
        public void RuleActionInvoked(string ActionName)
        {
            if (_recordContext != null)
            {
                _incidentRecord = _recordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Incident) as IIncident;
                if (form.IsDisposed == true)
                {
                    form = new ProgressForm();
                }
                switch (ActionName)
                {
                case "singleWarrantyCheck":
                    form.Show();

                    SingleWarrantyModel singleWarranty = new SingleWarrantyModel();
                    singleWarranty.WarrantyCheck(_incidentRecord);
                    form.Hide();
                    _recordContext.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
                    break;

                case "massWarrantyCheck":

                    form.Show();
                    MultiVinWarrantyModel massWarranty = new MultiVinWarrantyModel();
                    massWarranty.MultiVinWarrantyCheck(_incidentRecord);
                    form.Hide();
                    _recordContext.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
                    break;

                case "selectVIN":
                    //If existing record
                    if (_incidentRecord != null && _incidentRecord.ID > 0)
                    {
                        selectSR_VIN();
                        //System.Threading.Thread selectSrVinThread = new System.Threading.Thread(selectSR_VIN);
                        //selectSrVinThread.Start();
                    }
                    //If new then first create the incident and then call function to show SR/VIN form
                    else
                    {
                        _showSRFormAfterSave = true;
                        _recordContext.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
                    }

                    break;

                case "orderParts":
                    form.Show();
                    PartsOrderModel partsOrder = new PartsOrderModel();
                    partsOrder.OrderParts(_incidentRecord);
                    form.Hide();
                    _recordContext.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
                    break;

                case "populateExpirationDate":
                    ExpirationDate expdate = new ExpirationDate(_recordContext);
                    expdate.SetExpirationDate();
                    break;

                case "supplierWarrantyCheck":
                    // This functionality is taken care in CPM

                    /*form.Show();
                    *  SupplierWarrantyCheckModel supplierWarranty = new SupplierWarrantyCheckModel();
                    *  supplierWarranty.GetDetails(_incidentRecord,_recordContext);
                    *  form.Hide();*/
                    //_recordContext.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
                    break;

                default:
                    break;
                }
            }
        }