public string GetMessegeFromUserByTrafficSign(string uniqueString, string stringForDisable, string stringForDisableCarNum, string stringForParkingNote, string parkingPermitAreaNum, string stringDateTime) //char parkingPermitAreaNum is 0 if not parking permit { StringBuilder stringToSend = null; ClientUser userDetails = new ClientUser(stringForDisable, stringForDisableCarNum, stringForParkingNote, parkingPermitAreaNum); TrafficSign trafficSign = new TrafficSign(uniqueString, stringDateTime); SubNotesTS suitableSubNotes = null; string result = string.Empty; result = checkSpetialUniqueString(uniqueString, userDetails); if (result.Equals(string.Empty)) { suitableSubNotes = trafficSign.getSuitableSubNotes(); if (suitableSubNotes != null) { stringToSend = messageBuilder(suitableSubNotes, userDetails); } else { stringToSend = canParkMessageBuilder(); stringToSend.Append(",,,"); } return(stringToSend.ToString()); } return(result); }
public StringBuilder logicSymbolsCheckAfterUserCanPark(SubNotesTS suitableSubNotes) { StringBuilder stringToSend = this.canParkMessageBuilder(); if (suitableSubNotes.CanParkForMore != null) { stringToSend.Append(suitableSubNotes.CanParkForMore + ","); } else { stringToSend.Append(","); } if (suitableSubNotes.IsPaid) { stringToSend.Append("Paid,"); } else { stringToSend.Append(","); } if (suitableSubNotes.ImportantNote != null) { stringToSend.Append(suitableSubNotes.ImportantNote); } else { stringToSend.Append(","); } return(stringToSend); }
public StringBuilder messageBuilder(SubNotesTS suitableSubNotes, ClientUser clientUser) { bool canPark = true; StringBuilder stringToSend = null; if (suitableSubNotes.CantPark || (suitableSubNotes.Disable && suitableSubNotes.DisableCarNum.Equals(string.Empty) && (!clientUser.IsDisabled)) || ((suitableSubNotes.Disable && !suitableSubNotes.DisableCarNum.Equals(string.Empty)) && (!clientUser.DisableCarNumber.Equals(suitableSubNotes.DisableCarNum))) || (suitableSubNotes.GetParkingPermitObject() != null && !suitableSubNotes.GetParkingPermitObject().GetParkingPermitAreaNum().Equals(clientUser.GetParkingPermitObject().GetParkingPermitAreaNum()))) { canPark = false; } if (canPark) { stringToSend = logicSymbolsCheckAfterUserCanPark(suitableSubNotes); } else { stringToSend = canNotParkMessageBuilder(); } return(stringToSend); }