private static string ValidateIndication(Indication indication) { if (!string.IsNullOrEmpty(indication.Name)) { return(string.Empty); } else { return("Fill Name field!"); } }
private static string ValidateIndication(Indication indication) { if (!string.IsNullOrEmpty(indication.Name)) { return string.Empty; } else { return "Fill Name field!"; } }
public string UpdateIndication(Indication indication) { var message = ValidateIndication(indication); if (string.IsNullOrEmpty(message)) { bool isProcessDone = UpdateEntity<Indication>(indication); if (isProcessDone) { log.Info(string.Format("Indication {0} changed", indication.Code)); return string.Empty; } else { return "Code will be UNIQE!"; } } else { return message; } }
public string UpdateIndication(Indication indication) { var message = ValidateIndication(indication); if (string.IsNullOrEmpty(message)) { bool isProcessDone = UpdateEntity <Indication>(indication); if (isProcessDone) { log.Info(string.Format("Indication {0} changed", indication.Code)); return(string.Empty); } else { return("Code will be UNIQE!"); } } else { return(message); } }
public string EditIndication(DtoIndication dtoIndication) { var uniqueIndication = IndicationMethods.Instance.GetIndicationByCode(dtoIndication.Code); if (!dtoIndication.IsEdit) { var indication = new Indication() { Code = dtoIndication.Code, Name = dtoIndication.Name }; return IndicationMethods.Instance.InsertIndication(indication); } else { var indication = new Indication() { Id = uniqueIndication.Id, Code = dtoIndication.Code, Name = dtoIndication.Name }; return IndicationMethods.Instance.UpdateIndication(indication); } }