public GetCompaniesResponseView( CompaniesView companyView, EventNotification.Entities.EventNotification eventNotification) { Data = companyView; ErrorMessages = eventNotification.Errors.Select(x => x.ToString()).ToList(); WarningMessages = eventNotification.Warnings.Select(x => x.ToString()).ToList(); }
protected void Page_Load(object sender, EventArgs e) { /* * String sqlStatement = "select Id AS 'Company Order', CompanyName AS 'Company Name', HttpAddress AS 'URL', "; * sqlStatement += "NumberOfUser AS 'Number Of User' , CompanyValue AS 'Company Value (million dollars)', "; * sqlStatement += "CONVERT(VARCHAR(10), LaunchedDate, 103) AS 'Launched Date (DD/MM/YYYY)' from Companies "; * sqlStatement += "order by Id"; * * loadGridView(sqlStatement); */ CompaniesView.DataSource = null; CompaniesView.DataBind(); }
protected void loadGridView(String sqlStatement) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\SocialNetworks.mdf;Integrated Security=True"); SqlCommand cmd = new SqlCommand(sqlStatement, con); con.Open(); SqlDataReader wan = cmd.ExecuteReader(); CompaniesView.DataSource = wan; CompaniesView.DataBind(); con.Close(); }
/// <summary> /// 获取责任单位 /// </summary> /// <param name="checkItemList"></param> /// <param name="roleType"></param> /// <param name="projectId"></param> /// <returns></returns> private object GetListCom(List <Epm_CheckItem> checkItemList, string roleType, long projectId) { //List<Epm_ProjectCompany> companyList = new List<Epm_ProjectCompany>(); //var user = CurrentUserView; //using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(user))) //{ // var companyResult = proxy.GetProjectCompanyList(projectId); // if (companyResult.Flag == EResultFlag.Success && companyResult.Data != null) // { // companyList = companyResult.Data.Where(p => p.ProjectId == projectId && !string.IsNullOrWhiteSpace(p.CompanyName)).ToList(); // } //} if (checkItemList.Any()) { List <CompaniesView> companies = new List <CompaniesView>(); var distinctcheckItem = checkItemList.Where(t => t.RoleType == roleType && t.Level == 3).Select(a => new { a.ScoreCompany, a.RectificationManName }).Distinct().ToList(); #region 责任单位 if (distinctcheckItem.Any()) { foreach (var item in distinctcheckItem) { CompaniesView company = new CompaniesView(); if (item.ScoreCompany.IndexOf(",") == -1 && item.RectificationManName.IndexOf(",") == -1) { company.id = item.ScoreCompany; company.name = string.IsNullOrEmpty(item.ScoreCompany) ? "" : ((RectificationCompany)Enum.Parse(typeof(RectificationCompany), item.ScoreCompany)).GetText(); CompaniesView personnel = new CompaniesView(); personnel.id = item.RectificationManName; personnel.name = string.IsNullOrEmpty(item.RectificationManName) ? "" : ((RectificationPeople)Enum.Parse(typeof(RectificationPeople), item.RectificationManName)).GetText(); company.personnelList.Add(personnel); } companies.Add(company); } } #endregion return(companies); } return((new List <object>() { }).ToArray()); }
private object GetListComs(List <Epm_CheckItem> checkItemList, string roleType, long projectId, long id) { if (checkItemList.Any()) { List <CompaniesView> companies = new List <CompaniesView>(); var distinctcheckItem = checkItemList.Where(t => t.RoleType == roleType && t.Level == 3 && t.Id == id).Select(a => new { a.ScoreCompany, a.RectificationManName }).Distinct().ToList(); #region 责任单位 if (distinctcheckItem.Any()) { foreach (var item in distinctcheckItem) { CompaniesView company = new CompaniesView(); if (item.ScoreCompany.IndexOf(",") == -1 && item.RectificationManName.IndexOf(",") == -1) { company.id = item.ScoreCompany; company.name = string.IsNullOrEmpty(item.ScoreCompany) ? "" : ((RectificationCompany)Enum.Parse(typeof(RectificationCompany), item.ScoreCompany)).GetText(); CompaniesView personnel = new CompaniesView(); personnel.id = item.RectificationManName; personnel.name = string.IsNullOrEmpty(item.RectificationManName) ? "" : ((RectificationPeople)Enum.Parse(typeof(RectificationPeople), item.RectificationManName)).GetText(); company.personnelList.Add(personnel); } companies.Add(company); } } #endregion return(companies); } return((new List <object>() { }).ToArray()); }