public Struct(int unitNetworkId, RecallStatus status, ObjectType type, int duration) { UnitNetworkId = unitNetworkId; Status = status; Type = type; Duration = duration; }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (VolumeFreeSpacePercent > 100) { throw new ValidationException(ValidationRules.InclusiveMaximum, "VolumeFreeSpacePercent", 100); } if (VolumeFreeSpacePercent < 0) { throw new ValidationException(ValidationRules.InclusiveMinimum, "VolumeFreeSpacePercent", 0); } if (TierFilesOlderThanDays > 2147483647) { throw new ValidationException(ValidationRules.InclusiveMaximum, "TierFilesOlderThanDays", 2147483647); } if (TierFilesOlderThanDays < 0) { throw new ValidationException(ValidationRules.InclusiveMinimum, "TierFilesOlderThanDays", 0); } if (SyncStatus != null) { SyncStatus.Validate(); } if (CloudTieringStatus != null) { CloudTieringStatus.Validate(); } if (RecallStatus != null) { RecallStatus.Validate(); } }
public RandomUltRecall(AIHeroClient unit, RecallStatus status) { Unit = unit; Status = status; Started = 0; Ended = 0; Duration = 0; }
//public string GetOrderPDFFilePDO(int iPDOOrderID) //{ // try // { // OrderPDOFullModel rfm = orderPDORepo.GetOrderByID(iPDOOrderID); // string curFile = ""; // string sResult = ""; // if (rfm != null) // { // rfm.NarociloStevilka_P = (rfm.NarociloStevilka_P != null) ? rfm.NarociloStevilka_P : "xxx"; // // če je 5x neuspešno, potem se pošlje mail Daniju // if ((rfm.P_UnsuccCountCreatePDFPantheon >= 5) && (rfm.P_SendWarningToAdmin == 0)) // { // messageRepo.CreateEmailForAdmin_NoPDFForOrder("", rfm.NarociloStevilka_P.ToString(), rfm.P_TransportOrderPDFName, false); // rfm.P_SendWarningToAdmin = 1; // return "NOT_EXIST"; // } // else if (rfm.P_SendWarningToAdmin == 1) // { // DataTypesHelper.LogThis("Za naročilo št. " + rfm.NarociloStevilka_P + " ni bilo kreirano PDF in je bil poslal že mail administraotrju."); // return "NOT_EXIST"; // } // curFile = ((rfm.P_TransportOrderPDFDocPath != null) && (rfm.P_TransportOrderPDFDocPath.Length > 0)) ? rfm.P_TransportOrderPDFDocPath : ""; // sResult = File.Exists(curFile) ? "EXIST" : "NOT_EXIST"; // } // if (sResult != "EXIST") // { // LaunchPantheonCreatePDF(); // rfm.P_UnsuccCountCreatePDFPantheon++; // rfm.P_LastTSCreatePDFPantheon = DateTime.Now; // } // else // { // InquiryStatus stat = orderPDORepo.GetPovprasevanjaStatusByCode(Enums.StatusOfInquiry.KREIRAN_POSLAN_PDF.ToString()); // if (stat != null) // { // rfm.StatusID = stat.StatusPovprasevanjaID; // rfm.P_GetPDFOrderFile = DateTime.Now; // // Create mail for prevoznik // messageRepoPDO.CreateEmailForSupplierOrder(rfm); // } // } // orderPDORepo.SaveOrder(rfm, true, false); // return sResult; // } // catch (Exception ex) // { // throw ex; // } //} public void CreateOrderTransport(CreateOrderModel model) { try { RecallFullModel rfm = recallRepo.GetRecallFullModelByID(model.RecallID); if (rfm.P_CreateOrder.Year < 2000) { DataTypesHelper.LogThis("cREATE oRDER xml"); string xml = GetXMLForOrder(model); DataTypesHelper.LogThis(xml); DataTypesHelper.LogThis("Run Create order procedure _upJM_CreateSupplierOrder"); // run store procedure _upJM_CreateSupplierOrder CreateOrderDocument coData = sqlFunctionRepo.GetOrderDocumentData(xml); DataTypesHelper.LogThis("Update Create order Recall Data"); // update odpoklic - uspešno kreirana naročilnica v pantheonu RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.USTVARJENO_NAROCILO.ToString()); if (stat != null) { rfm.StatusID = stat.StatusOdpoklicaID; } rfm.P_UnsuccCountCreatePDFPantheon = 0; rfm.P_CreateOrder = DateTime.Now; rfm.P_TransportOrderPDFName = coData.PDFFile.ToString(); rfm.P_TransportOrderPDFDocPath = coData.ExportPath.ToString(); recallRepo.SaveRecall(rfm, true); //DataTypesHelper.LogThis("Launch Create PDF Pantheon.exe"); // launch Pantheon EXE command //LaunchPantheonCreatePDF(); DataTypesHelper.LogThis("Finish CreateOrderTransport"); } } catch (Exception ex) { throw ex; } }
public Recall(AIHeroClient unit, RecallStatus status) { Unit = unit; Status = status; }
public IHttpActionResult SaveRecall([FromBody] object recallData) { WebResponseContentModel <RecallFullModel> model = null; try { DataTypesHelper.LogThis("SaveRecall : (model.Content.OdpoklicID) - Začetek!"); model = JsonConvert.DeserializeObject <WebResponseContentModel <RecallFullModel> >(recallData.ToString()); if (model.Content != null) { var employee = employeeRepo.GetEmployeeByID(model.Content.UserID); if (model.Content.OdpoklicID > 0)//We update existing record in DB { DataTypesHelper.LogThis("SaveRecall1 : (model.Content.OdpoklicID) :" + model.Content.OdpoklicID.ToString()); recallRepo.SaveRecall(model.Content); RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.V_ODOBRITEV.ToString()); if (model.Content.RecallStatusChanged && (stat != null && model.Content.StatusID == stat.StatusOdpoklicaID)) { //messageEventsRepo.CreateEmailForRecallStatusChanged(model.Content); DataTypesHelper.LogThis("SaveRecall : " + stat.Koda); messageEventsRepo.CreateEmailForLeaderToApproveRecall(model.Content); } stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.RAZPIS_PREVOZNIK.ToString()); if (model.Content.RecallStatusChanged && (stat != null && model.Content.StatusID == stat.StatusOdpoklicaID)) { DataTypesHelper.LogThis("SaveRecall : " + stat.Koda); messageEventsRepo.CreateEmailForCarriers(model.Content, employee); } } else // We add and save new recod to DB { DataTypesHelper.LogThis("SaveRecall2 : (model.Content.OdpoklicID) :" + model.Content.OdpoklicID.ToString()); model.Content.OdpoklicID = recallRepo.SaveRecall(model.Content, false); RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.V_ODOBRITEV.ToString()); if (stat != null && model.Content.StatusID == stat.StatusOdpoklicaID) { DataTypesHelper.LogThis("SaveRecall2 : " + stat.Koda); messageEventsRepo.CreateEmailForLeaderToApproveRecall(model.Content); } stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.RAZPIS_PREVOZNIK.ToString()); if (model.Content.RecallStatusChanged && (stat != null && model.Content.StatusID == stat.StatusOdpoklicaID)) { DataTypesHelper.LogThis("SaveRecall3 : " + stat.Koda); messageEventsRepo.CreateEmailForCarriers(model.Content, employee); } } model.IsRequestSuccesful = true; } else { model.IsRequestSuccesful = false; model.ValidationError = ValidationExceptionError.res_09; } } catch (Exception ex) { model.IsRequestSuccesful = false; model.ValidationError = ExceptionValidationHelper.GetExceptionSource(ex); return(Json(model)); } return(Json(model)); }
public Recall(AIHeroClient unit, RecallStatus status) { this.Unit = unit; this.Status = status; }
public string GetOrderPDFFile(int iRecallID) { try { RecallFullModel rfm = recallRepo.GetRecallFullModelByID(iRecallID); string curFile = ""; string sResult = ""; if (rfm != null) { //če je 5x neuspešno, potem se pošlje mail Daniju if ((rfm.P_UnsuccCountCreatePDFPantheon >= 5) && (rfm.P_SendWarningToAdmin == 0)) { RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.ERR_ADMIN_MAIL.ToString()); if (stat != null) { rfm.StatusID = stat.StatusOdpoklicaID; } messageRepo.CreateEmailForAdmin_NoPDFForOrderOTP("", rfm.OdpoklicStevilka.ToString(), rfm.P_TransportOrderPDFName); rfm.P_SendWarningToAdmin = 1; recallRepo.SaveRecall(rfm, true); return("NOT_EXIST"); } else if (rfm.P_SendWarningToAdmin == 1) { RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.ERR_ADMIN_MAIL.ToString()); if (stat != null) { rfm.StatusID = stat.StatusOdpoklicaID; } DataTypesHelper.LogThis("Za naročilo št. " + rfm.OdpoklicStevilka + " ni bilo kreirano PDF in je bil poslal že mail administratorju."); return("NOT_EXIST"); } //TimeSpan timeDiff = DateTime.Now - rfm.P_LastTSCreatePDFPantheon; //if (timeDiff.TotalMinutes < 5) return ""; curFile = ((rfm.P_TransportOrderPDFDocPath != null) && (rfm.P_TransportOrderPDFDocPath.Length > 0)) ? rfm.P_TransportOrderPDFDocPath : ""; sResult = File.Exists(curFile) ? "EXIST" : "NOT_EXIST"; if (sResult != "EXIST") { RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.ERR_ORDER_NO_SEND.ToString()); if (stat != null) { rfm.StatusID = stat.StatusOdpoklicaID; } DataTypesHelper.LogThis("NOT EXIST : " + rfm.OdpoklicStevilka); LaunchPantheonCreatePDF(); rfm.P_UnsuccCountCreatePDFPantheon++; rfm.P_LastTSCreatePDFPantheon = DateTime.Now; } else { RecallStatus stat = recallRepo.GetRecallStatusByCode(Enums.StatusOfRecall.KREIRAN_POSLAN_PDF.ToString()); if (stat != null) { DataTypesHelper.LogThis("Exist send order to carriaer: " + rfm.OdpoklicStevilka); rfm.StatusID = stat.StatusOdpoklicaID; rfm.P_GetPDFOrderFile = DateTime.Now; // Create mail for prevoznik DataTypesHelper.LogThis("Start send email: " + rfm.OdpoklicStevilka); messageRepo.CreateEmailForCarrierOrder(rfm); } } recallRepo.SaveRecall(rfm, true); } return(sResult); } catch (Exception ex) { throw ex; } }