public async Task <CompanyMaster> getComapnyDtl(int COMPID) { try { CompanyMaster obj = new CompanyMaster(); Xdoc = DBXML.CLIENTCONNECTION_h(COMPID, 0); dt = SqlExev2.GetDT(Xdoc, dbConnectionString); obj = (from row in dt.AsEnumerable() select new CompanyMaster { CompName = row.Field <string>("compName"), ServerName = row.Field <string>("serverName"), AuthType = row.Field <string>("AuthType"), UserName = row.Field <string>("userName"), PASSWORD = row.Field <string>("PASSWORD"), DatabaseName = row.Field <string>("databaseName") //isActive = row.Field<string>("isActive"), //createdOn = row.Field<string>("createdOn"), //ceatedBy = row.Field<string>("ceatedBy"), }).FirstOrDefault(); return(await Task.Factory.StartNew(() => obj)); //return obj; } catch (Exception ex) { throw; } }
public object FillCONTROLNO(int CONTROLENO, string DESC, int Flag, XElement LOGXML = null) { Xdoc = DBXML.ST_SYSCONTROLENO_h(CONTROLENO, DESC, Flag, LOGXML); dt = SqlExev2.GetDT(Xdoc, ConStr); var dbResult = (from row in dt.AsEnumerable() select new { id = row.Field <int>("idYear"), STARTDATE = row.Field <DateTime>("STARTDATE"), text = row.Field <string>("cYearDescription") }).ToList(); return(dbResult); }
public async Task <string> getComapnyConnectionstr(int COMPID) { try { CompanyMaster obj = new CompanyMaster(); Xdoc = DBXML.CLIENTCONNECTION_h(COMPID, 0); dt = SqlExev2.GetDT(Xdoc, dbConnectionString); obj = (from row in dt.AsEnumerable() select new CompanyMaster { CompName = row.Field <string>("compName"), ServerName = row.Field <string>("serverName"), AuthType = row.Field <string>("AuthType"), UserName = row.Field <string>("userName"), PASSWORD = row.Field <string>("PASSWORD"), DatabaseName = row.Field <string>("databaseName") }).FirstOrDefault(); string connectionString = ""; if (obj != null) { string connetion = ""; if (obj.AuthType == "SQL Server Authentication") { connetion = "Data Source=" + obj.ServerName + ";Initial Catalog=" + obj.DatabaseName + ";User ID=" + obj.UserName + ";Password="******";"; } else { connetion = "Data Source=" + obj.ServerName + ";Initial Catalog=" + obj.DatabaseName + ";Integrated Security=true;"; } connectionString = connetion; } return(await Task.Factory.StartNew(() => connectionString)); //return obj; } catch (Exception ex) { throw; } }
public DataTable GetLookupExport(int MENUID, int flag, int USERID, int PAGENO, XElement FILTERXML, XElement LOGXML = null) { Xdoc = DBXML.ST_GetLookupData(MENUID, flag, USERID, PAGENO, FILTERXML, LOGXML); dt = SqlExev2.GetDT(Xdoc, ConStr); return(dt); }