Пример #1
0
 private static string ValidateIndication(Indication indication)
 {
     if (!string.IsNullOrEmpty(indication.Name))
     {
         return string.Empty;
     }
     else
     {
         return "Fill Name field!";
     }
 }
Пример #2
0
 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;
     }
 }
Пример #3
0
 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);
     }
 }