public bool SaveSricFAData(string action, out string msg) { msg = string.Empty; bool success = false; if (SricFAData == null || SricFAData.Count == 0) { return(success); } if (SricFAData.Any(n => string.IsNullOrWhiteSpace(n.FAName))) { msg = "At least Agency Name / Sponsor Name Required."; return(success); } if (SricFAData.GroupBy(n => n.FAName.Trim().ToLower()).Any(c => c.Count() > 1)) { msg = "Duplicate Organization / Agency Name Exist.! Data saving aborted."; return(success); } foreach (var item in SricFAData) { item.FAName = item.FAName.Trim(); item.MenuID = DataAccess.Enum.Menu.SRICFA.ToString(); item.DeptID = SessionManager.DeptID; item.DataUser = SessionManager.UserName; item.DataUpdatedOn = DateTime.Now; item.DataCaptYM = SessionManager.DataCaptYR; item.DataStatus = FormCommonMethods.GetStatusByAction(action); item.DataValid = "Y"; item.DataLocked = "N"; item.DataStatusLog = SessionManager.UserName + " " + DateTime.Now.ToString("ddd, dd MMM yyyy HH:mm:ss"); } try { FormsRepository formsRepository = new FormsRepository(); DataTable dt = ToDataTable(SricFAData); success = formsRepository.UpdateBulkSricFAFormData(dt, SessionManager.DataCaptYR, SessionManager.DeptID); } catch (Exception ex) { } return(success); }