Beispiel #1
0
 public string this[string columnName]
 {
     get
     {
         if (columnName == "ActionDate")
         {
             if (string.IsNullOrEmpty(ActionDate.ToString()))
             {
                 return("Action date is required");
             }
         }
         if (columnName == "ActionReason")
         {
             if (string.IsNullOrEmpty(ActionReason))
             {
                 return("Action reason is required");
             }
         }
         if (columnName == "ActionBy")
         {
             if (string.IsNullOrEmpty(ActionBy))
             {
                 return("Action by is required");
             }
         }
         //if (columnName == "PreviousTitle")
         //{
         //    if (string.IsNullOrEmpty(PreviousTitle.ToString()))
         //        return "Previous title is required";
         //}
         //if (columnName == "PreviousNode")
         //{
         //    if (string.IsNullOrEmpty(PreviousNode.ToString()))
         //        return "Previous node is required";
         //}
         if (columnName == "NewTitle")
         {
             if (string.IsNullOrEmpty(NewTitle.ToString()))
             {
                 return("New title is required");
             }
         }
         if (columnName == "NewNode")
         {
             if (string.IsNullOrEmpty(NewNode.ToString()))
             {
                 return("New node is required");
             }
         }
         if (columnName == "Type")
         {
             if (string.IsNullOrEmpty(Type.ToString()))
             {
                 return("The Type either promotion or demotion is required");
             }
         }
         return(string.Empty);
     }
 }