public static bool WriteLogMessages(string ErrorMsg)
        {
            bool rval = true;

            if (Convert.ToString(ConfigurationManager.AppSettings["IsLogMessageEnable"]) == "0")
            {
                return(rval);
            }
            try
            {
                File.AppendAllText(LogMessagePath, Environment.NewLine + "[" + DateTime.Now + "]" + " " + ErrorMsg);
            }
            catch (Exception ex)
            {
                SuiteWrapper.WriteTraceLog("WriteLogMessages", "Error Message : " + ex.Message);
            }
            return(rval);
        }
        public bool ValidateRequest(object instance, out string StrResp)
        {
            SuiteWrapper.WriteTraceLog("ValidateRequest", "Validate Request Start Date:" + DateTime.Now);
            bool RetVal = true;

            StrResp = string.Empty;
            var context = new ValidationContext(instance, serviceProvider: null, items: null);
            var results = new List <ValidationResult>();
            var isValid = Validator.TryValidateObject(instance, context, results, true);

            if (!isValid)
            {
                foreach (var validationResult in results)
                {
                    StrResp = StrResp + validationResult.ErrorMessage + ",";
                }

                StrResp = StrResp.TrimEnd(',');
                RetVal  = false;
            }
            SuiteWrapper.WriteTraceLog("ValidateRequest", "Validate Request End Date:" + DateTime.Now);
            return(RetVal);
        }