public GetDetailsResponseData Details() { GetDetailsResponseData response = new GetDetailsResponseData(); try { DataTable dt = new EntityCall.SPCompanyInformation(_Companyinformation).GetCompanyDetails(_Companyinformation.CompanyID); if (dt.IsValid()) { DataRow row = dt.Rows[0]; var result = new Company.GetDetailsResponse() { CompanyName = row.GetString("Name"), CompanyID = row.GetInt("CompanyID"), Url = row.GetString("CompanyStatus"), Status = row.GetInt("CompanyStatus") }; response.Data = result; } } catch (Exception ex) { //response = Response.Failed(response, ex, "", System.Reflection.MethodBase.GetCurrentMethod().Name, _companyinfo.PrivateConnectionString, _companyinfo.CompanyID); } return(response); }
public NOCModuleInfra(Company.GetDetailsResponse companyinfo) { if (companyinfo.CompanyID == 0) { throw new Exception("Incorrect URL. Please verify the URL and try again"); } //For DAL _Companyinformation = companyinfo; }
private Company.GetDetailsResponse GetCompanyDetails(Company.GetDetailsResponse comp) { return(new Company.GetDetailsResponse { CompanyID = comp.CompanyID, CompanyName = comp.CompanyName, Status = comp.Status, Url = comp.Url }); }
private Company.GetDetailsResponse ParseCompanyInfo(DataTable result) { Company.GetDetailsResponse companyInfo = new Company.GetDetailsResponse(); if (result != null && result.Rows.Count > 0) { companyInfo = new Company.GetDetailsResponse { Url = result.Rows[0]["CompanyUrl"].ToString(), CompanyID = Convert.ToInt64(result.Rows[0]["CompanyId"]), CompanyName = result.Rows[0]["CompanyName"].ToString(), PrivateConnectionString = result.Rows[0]["PrivateConnectionString"].ToString(), }; } else { companyInfo.CompanyID = 0; } return(companyInfo); }
public RequestManager() { string appUrl = "localhost:1843";//GetAppUrl(); if (!string.IsNullOrEmpty(appUrl) && _companyinfo == null) { try { _companyinfo = GetCompanyInfo(appUrl); } catch (Exception ex) { if (!File.Exists(HttpContext.Current.Server.MapPath("~/Errorlog.txt"))) { File.WriteAllLines(HttpContext.Current.Server.MapPath("~/Errorlog.txt"), new[] { ex.ToString() }); } else { File.AppendAllLines(HttpContext.Current.Server.MapPath("~/Errorlog.txt"), new[] { ex.ToString() }); } //SqlManager.InsertLogEntries(ex.ToString(), "ACN-RequestManager method", "RequestManager()", _companyinfo == null ? Providers.Utility.Config.AuthContext : _companyinfo.PrivateConnectionString); } } }