123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using Ant.Data;
- using Ant.ORM;
- using MES.Production.Entity;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace ChangFa.Machinery.WebPage.Controllers
- {
- public class TestController : Controller
- {
- MES.Production.Service.IService.ISystemManage SystemManage { get; set; }
- //
- // GET: /Test/
- /// <summary>
- /// 测试数据库是否联通
- /// </summary>
- public ActionResult Index()
- {
- try
- {
- string str = "Wrong";
- if (SystemManage.LoadAll(null).Any())
- str = "Success";
- Response.Write(str);
- try
- {
- using (this.SystemManage.Transaction)
- {
- Response.Write(this.SystemManage.LoadAll(null).Count());
- this.SystemManage.Commit();
- }
- }
- catch (Exception e) { this.SystemManage.Rollback(); }
- return View();
- }
- catch (Exception e) { throw e; }
-
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sportid"></param>
- /// <param name="seid"></param>
- /// <param name="keysn"></param>
- /// <returns></returns>
- public ActionResult SporterMatchDetail(int? sportid, int? seid, string keysn)
- {
- SporterInfo sporterInfo = new SporterInfo();
- if (sportid != null)
- {
- using (AntORM orm = new AntORM())
- {
- try
- {
- orm.db = DataAccessFactory.CreateDataConnection("CyclingItem");
- RequestItemSqlModel request = new RequestItemSqlModel
- {
- newSt = new SqlNote() { Author = "季健国", NewSt = new System.Diagnostics.StackTrace(true), SqlDesc = "导出报名信息" },
- };
- string strsql = @"SELECT b.*,c.SmallEventName
- FROM YW_MatchReport as a
- LEFT JOIN YM_Sporter as b on a.SporterID=b.ID
- LEFT JOIN YW_ProjectEntry as c on a.PEID=c.ID
- LEFT JOIN YW_SportsEvent as d on a.SEPID=d.ID
- where a.SEPID=" + seid + " and b.ID=" + sportid + " and d.State<5";
- request.StrSql = strsql;
- var result = orm.GetDataTableList(request);
- if (result.IsSuccess)
- {
- string item = ""; DataRow drr = result.DataTable.Rows[0];
- sporterInfo.Name = drr["Name"].ToString();
- sporterInfo.SporterPicUrl = drr["SporterPicUrl"].ToString();
- sporterInfo.StudentNoPicUrl = drr["StudentNoPicUrl"].ToString();
- sporterInfo.IDCard = drr["IDCard"].ToString();
- sporterInfo.SchoolName = drr["SchoolName"].ToString();
- sporterInfo.StudentNo = drr["StudentNo"].ToString();
- foreach (DataRow dr in result.DataTable.Rows)
- {
- item = item + "," + dr["SmallEventName"].ToString();
- }
- sporterInfo.ItemList = string.Join(",", item.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
- }
- }
- catch (Exception e)
- {
- }
- }
- }
- return View(sporterInfo);
- }
- }
- }
|