/// <summary> /// Save Error log /// </summary> /// <param name="lsErrorlog">detail error log info</param> /// <returns>Boolean Value</returns> public Boolean SaveLog(List <cstErrorLog> lsErrorlog) { Boolean _return = false; try { if (lsErrorlog.Count > 0) { foreach (var _Erroritem in lsErrorlog) { ErrorLog _errorCustom = new ErrorLog(); _errorCustom.ErrorLogID = Guid.NewGuid(); _errorCustom.ErrorLocation = _Erroritem.ErrorLocation; _errorCustom.ErrorDesc = _Erroritem.ErrorDesc; _errorCustom.ErrorTime = Convert.ToDateTime(_Erroritem.ErrorTime); _errorCustom.UserID = _Erroritem.UserID; entX3v6.AddToErrorLogs(_errorCustom); entX3v6.SaveChanges(); _return = true; } } } catch (Exception) { ///Save the Exeption to the File Name Bellow String[] Lines = { "", "" };; Lines[0] = Environment.NewLine + "------------------------------------------------" + DateTime.UtcNow + "------------------------------------------------"; Lines[1] = "Internet Connection Fail == " + lsErrorlog[0].ErrorLocation.ToString() + " == " + DateTime.UtcNow; File.AppendAllLines("C:\\ShipmentManagerErrorLog.sys", Lines); } return(_return); }