public string GetTestRoom() { StringBuilder Result = new StringBuilder(); string SqlCmd = @"SELECT NodeCode , DESCRIPTION ,OrderID,DepType, left(NodeCode,len(NodeCode)-4) as ParentID FROM dbo.Sys_Tree ORDER BY OrderID"; DataTable DT = new BLL_Document().GetDataTable(SqlCmd); DT.DefaultView.RowFilter = " ParentID = '' "; if (DT.DefaultView.ToTable().Rows.Count > 0) { DT.DefaultView.RowFilter = " ParentID = '" + DT.DefaultView.ToTable().Rows[0]["NodeCode"] + "' "; Result.Append("["); int i = 0; foreach (DataRow Dr in DT.DefaultView.ToTable().Rows) { if (TestRoomHasChildren(DT.DefaultView, Dr["NodeCode"].ToString())) { Result.Append(i == 0 ? "" : ","); Result.Append(TestRoomChildren(DT.DefaultView, Dr["NodeCode"].ToString(), Dr["DESCRIPTION"].ToString())); i++; } } Result.Append("]"); } DT.DefaultView.RowFilter = " "; return(Result.ToString()); }
private String failreportsum(string proc, int ntype) { BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetProcDataTableChartsPara5(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes, 1); if (dt != null) { List <ChartModel> list = new List <ChartModel>(); foreach (DataRow dr in dt.Rows) { ChartModel trcs = new ChartModel(); if (ntype == 1) { trcs.Description = dr["segment"].ToString() + "\n" + dr["company"].ToString(); trcs.Para1 = dr["companycode"].ToString(); trcs.IntNumber = Int32.Parse(dr["totalncount"].ToString()); trcs.IntNumberMarks = Int32.Parse(dr["counts"].ToString()); trcs.DoubleNumber = Double.Parse(dr["prenct"].ToString()); } else if (ntype == 2) { trcs.Description = dr["segment"].ToString() + "\n" + dr["company"].ToString() + "\n" + dr["testroom"].ToString(); trcs.IntNumber = Int32.Parse(dr["totalncount"].ToString()); trcs.IntNumberMarks = Int32.Parse(dr["counts"].ToString()); trcs.DoubleNumber = Double.Parse(dr["prenct"].ToString()); } list.Add(trcs); } return(JsonConvert.SerializeObject(list)); } else { return(""); } }
/// <summary> /// 获取原材料 /// </summary> public DataTable Items() { string Sql = "SELECT ItemID,ItemName FROM sys_TJ_Item where Status =1"; BLL_Document BLL = new BLL_Document(); return(GetDataSet(Sql).Tables[0]); }
private String qxzlhzbchartpop(string proc, string testcode) { BLL_Document BLL = new BLL_Document(); sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line; testcode = GetSelectTree(testcode, SelectedTestRoomCodes); DataTable dt = BLL.GetProcDataTableChartsPara5(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), testcode, 1); if (dt != null) { List <ChartModel> list = new List <ChartModel>(); foreach (DataRow dr in dt.Rows) { ChartModel trcs = new ChartModel(); trcs.Description = dr["testname"].ToString(); trcs.IntNumber = Int32.Parse(dr["ncount"].ToString()); trcs.Para1 = dr["modelid"].ToString(); trcs.Para2 = dr["segment"].ToString() + "-" + dr["company"].ToString(); list.Add(trcs); } return(JsonConvert.SerializeObject(list)); } else { return(""); } }
/// <summary> /// 添加 /// </summary> public string Add() { string Result = ""; try { string TestRoomCode = Request["TestRoomCode"].ToString(); string CompanyType = Request["CompanyType"].ToString(); string Name = "Name".RequestStr(); string IDCard = Request["IDCard"].ToString(); string Job = Request["Job"].ToString(); string Deduct = Request["Deduct"].ToString(); string Remark = Request["Remark"].ToString(); string RType = Request["RType"].ToString(); string CreateBy = Session["UserName"].ToString(); string Sql = @" INSERT INTO [dbo].[sys_ReditRating] ([SysID] ,[SegmentCode] ,[CompanyCode] ,[TestRoomCode] ,[CompanyType] ,[RType] ,[Name] ,[IDCard] ,[Job] ,[Deduct] ,[Remark] ,[CreateOn],[CreateBy] ,[ISDeleted]) VALUES ('{0}' ,'{1}' ,'{2}' ,'{3}' ,'{4}' ,'{5}' ,'{6}' ,'{7}' ,'{8}' ,'{9}' ,'{10}','{11}','{12}',1) "; Sql = string.Format(Sql, Guid.NewGuid().ToString(), TestRoomCode.Substring(0, 8), TestRoomCode.Substring(0, 12), TestRoomCode, CompanyType, RType, Name, IDCard, Job, Deduct, Remark, DateTime.Now.ToString(), CreateBy); BLL_Document BLL = new BLL_Document(); Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false"; } catch { Result = "false"; } return(Result); }
/// <summary> /// 获取原材料半成品 /// </summary> public static DataTable Items(string ItemType) { string Sql = "SELECT ItemID,ItemName FROM sys_TJ_Item where Status =1 AND ItemType=" + ItemType; BLL_Document BLL = new BLL_Document(); return(BLL.GetDataSet(Sql).Tables[0]); }
private String qxjqgridpop(string proc, int ftype, string startdate, string enddate, string testcode, string modelid) { BLL_Document BLL = new BLL_Document(); if (modelid.Length > 0) { DataTable dt = BLL.GetProcDataTableChartsPara6(proc, ftype, startdate, enddate, testcode, modelid); if (dt != null) { List <ChartModel> list = new List <ChartModel>(); foreach (DataRow dr in dt.Rows) { ChartModel trcs = new ChartModel(); trcs.Description = dr["chartDate"].ToString(); trcs.IntNumber = Int32.Parse(dr["zjCount"].ToString()); list.Add(trcs); } return(JsonConvert.SerializeObject(list)); } else { return(""); } } else { return(""); } }
/// <summary> /// 获取数据库实体 /// </summary> public void GetObj() { string Sql = @" select * from [dbo].[sys_ReditRating] where SysID = '" + "ID".RequestStr() + "' "; BLL_Document BLL = new BLL_Document(); using (IDataReader Read = BLL.ExcuteReader(Sql)) { try { Read.Read(); Obj.SysID = Read["SysID"].ToString(); Obj.Name = Read["Name"].ToString(); Obj.SegmentCode = Read["SegmentCode"].ToString(); Obj.CompanyCode = Read["CompanyCode"].ToString(); Obj.TestRoomCode = Read["TestRoomCode"].ToString(); Obj.IDCard = Read["IDCard"].ToString(); Obj.Job = Read["Job"].ToString(); Obj.Deduct = Read["Deduct"].ToString(); Obj.Remark = Read["Remark"].ToString(); Obj.CompanyType = Read["CompanyType"].ToString(); Obj.CreateOn = Read["CreateOn"].ToString(); Obj.RType = Read["RType"].ToString(); Obj.CreateBy = Session["UserName"].ToString(); } catch { } Read.Close(); Read.Dispose(); } }
public void GetLineName() { BLL_Document Bll = new BLL_Document(); JZ.BLL.sys_line sysBaseLine = Session["SysBaseLine"] as JZ.BLL.sys_line; LineName = sysBaseLine.LineName; }
/// <summary> /// 获取试验室 /// </summary> /// <returns></returns> public string GetTestRoom() { string Result = string.Empty; string Sql = @" select t.nodecode, s.description+'-'+c.description +'-'+t.description as description from Sys_tree t left outer join Sys_tree s on left(t.nodecode,8) = s.nodecode left outer join Sys_tree c on left(t.nodecode,12) = c.nodecode where t.NodeCode in ({0}) order by c.description asc "; BLL_Document BLL = new BLL_Document(); DataTable List = BLL.GetDataTable(string.Format(Sql, SelectedTestRoomCodes)); Result = JsonConvert.SerializeObject(List); return(Result); }
public void GetLineName() { //SELECT TOP 1 HigWayClassification FROM dbo.sys_engs_ProjectInfo WHERE Scdel=0 BLL_Document Bll = new BLL_Document(); LineName = Bll.ExcuteScalar("SELECT TOP 1 HigWayClassification FROM dbo.sys_engs_ProjectInfo WHERE Scdel=0").ToString(); }
/// <summary> /// 全线资料统计 /// </summary> /// <returns></returns> public DataTable QXZLTJ() { BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetProcDataTable("spweb_qxzlhzb", StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes, 0, 1, 100000, "segment", "ASC", out pageCount, out records); #region 添加总数 int pageCount1 = 0; int records1 = 0; string SelectedTestRoomCodes1 = ""; foreach (DataRow Dr in dt.Rows) { if (SelectedTestRoomCodes1.IndexOf("'" + Dr["testcode"].ToString() + "'") >= 0) { continue; } SelectedTestRoomCodes1 += string.IsNullOrEmpty(SelectedTestRoomCodes1) ? "'" + Dr["testcode"].ToString() + "'" : ",'" + Dr["testcode"].ToString() + "'"; } DataTable dt1 = BLL.GetProcDataTable("spweb_qxzlhzb", DateTime.Parse("1999-1-1").ToString("yyyy-MM-dd"), DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes1, 0, 1, 100000, "segment", "ASC", out pageCount1, out records1); dt.Columns.Add(new DataColumn("ncountA", typeof(string))); dt.Columns.Add(new DataColumn("wncountA", typeof(string))); DataTable _tempTable = new DataTable(); foreach (DataRow Dr in dt.Rows) { dt1.DefaultView.RowFilter = " testcode='" + Dr["testcode"].ToString() + "' AND modelid='" + Dr["modelid"].ToString() + "' "; _tempTable = dt1.DefaultView.ToTable(); Dr["ncountA"] = _tempTable.Rows.Count > 0 ? _tempTable.Rows[0]["ncount"].ToString() : ""; Dr["wncountA"] = _tempTable.Rows.Count > 0 ? _tempTable.Rows[0]["wncount"].ToString() : ""; dt1.DefaultView.RowFilter = ""; } #endregion dt.Columns.Remove("id"); dt.Columns.Remove("project"); dt.Columns.Remove("testcode"); dt.Columns.Remove("modelid"); dt.Columns["segment"].ColumnName = "标段"; dt.Columns["company"].ColumnName = "单位"; dt.Columns["testroom"].ColumnName = "试验室"; dt.Columns["testname"].ColumnName = "试验名称"; dt.Columns["ncountA"].ColumnName = "总录入数"; dt.Columns["ncount"].ColumnName = "时间段内录入数"; dt.Columns["wncountA"].ColumnName = "不合格报告总数"; dt.Columns["wncount"].ColumnName = "时间段内不合格报告数"; dt.Columns["总录入数"].SetOrdinal(4); dt.Columns["时间段内录入数"].SetOrdinal(5); dt.Columns["不合格报告总数"].SetOrdinal(6); dt.Columns["时间段内不合格报告数"].SetOrdinal(7); return(dt); }
public string GetCount() { string Result = "0"; BLL_Document BLL = new BLL_Document(); DataTable _Data = BLL.GetDataTable("SELECT DataID FROM dbo.sys_test_data WHERE DataID='" + Request["id"].ToString() + "' AND Status=1 order by SerialNumber asc"); Result = _Data.Rows.Count.ToString(); return(Result); }
/// <summary> /// 获取厂家 /// </summary> public static DataTable Factory(string ItemID) { string Sql = @" select [sys_TJ_Factory].FactoryID, [sys_TJ_Factory].FactoryName from [dbo].[sys_TJ_MainData] join [dbo].[sys_TJ_Item_Module] on [dbo].[sys_TJ_MainData].ModuleID = [dbo].[sys_TJ_Item_Module].ModuleID join [dbo].[sys_TJ_Factory] on [dbo].[sys_TJ_Factory].FactoryID = [dbo].[sys_TJ_MainData].FactoryID where [sys_TJ_Item_Module].ItemID = '" + ItemID + "' group by [sys_TJ_Factory].FactoryID, [sys_TJ_Factory].FactoryName "; BLL_Document BLL = new BLL_Document(); return(BLL.GetDataSet(Sql).Tables[0]); }
/// <summary> /// 获取强度等级 /// </summary> /// <returns></returns> public static DataTable QDDJ() { string Sql = @"select M.QDDJ from sys_TJ_MainData M join sys_TJ_Item I on I.ItemID = M.ItemID AND I.Status=1 AND I.ItemType =2 ANd I.ItemName in('混凝土抗压(同条件)','混凝土抗压') group by QDDJ"; BLL_Document BLL = new BLL_Document(); return(BLL.GetDataSet(Sql).Tables[0]); }
public void List() { string StartDate = "StartDate".RequestStr(); string EndDate = "EndDate".RequestStr().ToDateTime().ToString("yyyy-MM-dd"); #region SQL string Sql = @" --sass SELECT d.*,convert(varchar,d.ReportDate,23) as ReportDate1, d.F_InvalidItem as F_InvalidItem1,d.F_InvalidItem as F_InvalidItem2, case when AdditionalQualified =0 then '未合格' when AdditionalQualified =1 then '已合格' end as st FROM v_invalid_document d left outer join sys_module on d.ModelIndex = sys_module.id where F_InvalidItem NOT LIKE '%#%' and ReportDate between '{0}' AND '{1}' "; #endregion Sql = string.Format(Sql, StartDate, EndDate); BLL_Document BLL = new BLL_Document(); DataSet Ds = new DataSet(); using (System.Data.SqlClient.SqlConnection Conn = BLL.Connection as System.Data.SqlClient.SqlConnection) { Conn.Open(); using (System.Data.SqlClient.SqlCommand Cmd = new System.Data.SqlClient.SqlCommand(Sql, Conn)) { using (System.Data.SqlClient.SqlDataAdapter Adp = new System.Data.SqlClient.SqlDataAdapter(Cmd)) { Adp.Fill(Ds); } } Conn.Close(); } string Json = JsonConvert.SerializeObject(Ds.Tables[0]); Json = "{\"rows\":" + Json + ",\"total\":0}"; Response.Write(Json); Response.End(); }
/// <summary> /// 获取clomns字段 /// </summary> public static ItemCollection Attribute(string ItemID) { string Sql = "SELECT Columns FROM [dbo].[sys_TJ_Item] where ItemID = '" + ItemID + "' "; BLL_Document BLL = new BLL_Document(); JavaScriptSerializer serializer = new JavaScriptSerializer(); Item[] Temp = serializer.Deserialize <Item[]>(BLL.ExcuteScalar(Sql).ToString()); ItemCollection Items = new ItemCollection(); Items.Copy(Temp); return(Items); }
public string Del() { string SysID = "SysID".RequestStr(); if (SysID.IsNullOrEmpty()) { return(""); } string Sql = @" UPDATE [dbo].[sys_ReditRating] SET IsDeleted=0 WHERE SysID = '" + SysID + "' "; BLL_Document BLL = new BLL_Document(); return(BLL.ExcuteCommand(Sql) > 0 ? "true" : "false"); }
/// <summary> /// 添加 /// </summary> public string Edit() { string Result = ""; try { string TestRoomCode = Request["TestRoomCode"].ToString(); string CompanyType = Request["CompanyType"].ToString(); string Name = "Name".RequestStr(); string IDCard = Request["IDCard"].ToString(); string Job = Request["Job"].ToString(); string Deduct = Request["Deduct"].ToString(); string Remark = Request["Remark"].ToString(); string SysID = Request["SysID"].ToString(); string RType = Request["RType"].ToString(); string CreateBy = Session["UserName"].ToString(); string Sql = @" UPDATE [dbo].[sys_ReditRating] SET [SegmentCode] = '{0}' ,[CompanyCode] = '{1}' ,[TestRoomCode] = '{2}' ,[CompanyType] = '{3}' ,[RType] = '{11}' ,[Name] = '{4}' ,[IDCard] = '{5}' ,[Job] = '{6}' ,[Deduct] = '{7}' ,[Remark] = '{8}' ,[CreateBy] = '{9}' WHERE SysID = '{10}' "; Sql = string.Format(Sql, TestRoomCode.Substring(0, 8), TestRoomCode.Substring(0, 12), TestRoomCode, CompanyType, Name, IDCard, Job, Deduct, Remark, CreateBy, SysID, RType); BLL_Document BLL = new BLL_Document(); Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false"; } catch { Result = "false"; } return(Result); }
/// <summary> /// 型号 /// </summary> public static DataTable Model(string ItemID) { string Sql = @" select {0} as XH from [dbo].[sys_TJ_MainData] join [dbo].[sys_TJ_Item_Module] on [dbo].[sys_TJ_MainData].ModuleID = [dbo].[sys_TJ_Item_Module].ModuleID join [dbo].[sys_TJ_Item] on [dbo].[sys_TJ_Item].ItemID = [dbo].[sys_TJ_Item_Module].ItemID AND [dbo].[sys_TJ_Item_Module].ItemID ='{1}' AND {0} is not null group by {0}"; BLL_Document BLL = new BLL_Document(); ItemCollection Attrs = Attribute(ItemID); if (!Attrs.ContainsKey("型号")) { return(null); } return(BLL.GetDataSet(string.Format(Sql, Attrs["型号"].BindField, ItemID)).Tables[0]); }
/// <summary> /// 工程部位 /// </summary> public static DataTable Position(string ItemID) { string Sql = @" select SGBW from [dbo].[sys_TJ_MainData] join [dbo].[sys_TJ_Item_Module] on [dbo].[sys_TJ_MainData].ModuleID = [dbo].[sys_TJ_Item_Module].ModuleID join [dbo].[sys_TJ_Item] on [dbo].[sys_TJ_Item].ItemID = [dbo].[sys_TJ_Item_Module].ItemID AND [dbo].[sys_TJ_Item_Module].ItemID ='{0}' group by SGBW"; if (ItemID.IsNullOrEmpty()) { Sql = @" select SGBW from [dbo].[sys_TJ_MainData] group by SGBW"; } BLL_Document BLL = new BLL_Document(); return(BLL.GetDataSet(string.Format(Sql, ItemID)).Tables[0]); }
private String testdata(string id, string num) { BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetTestData(id, num); List <TestData> cells = new List <TestData>(); if (dt != null && dt.Rows.Count > 0) { int m = 0; DateTime d0 = new DateTime();//第一根开始时间 foreach (DataRow dr in dt.Rows) { List <JZTestDataCell> testdatalist; try { testdatalist = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZTestDataCell> >(dr["RealTimeData"].ToString()); } catch { testdatalist = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZTestDataCell> >(BizCommon.JZCommonHelper.GZipDecompressString(dr["RealTimeData"].ToString())); } int n = 0; foreach (JZTestDataCell item in testdatalist) { if (n == 0) { d0 = testdatalist[0].Time; } TimeSpan span = (TimeSpan)(item.Time - d0); TestData model = new TestData(); model.Time = Math.Round(span.TotalMilliseconds / 1000, 2); model.Value = item.Value; cells.Add(model); n++; } m++; } return(JsonConvert.SerializeObject(cells)); } else { return(""); } }
public void Sheet() { string Sql = "select id,name from sys_sheet where ID in (" + "SheetID".RequestStr() + ")"; BLL_Document BLL = new BLL_Document(); DataSet Ds = BLL.GetDataSet(Sql); string Json = JsonConvert.SerializeObject(Ds.Tables[0]); Response.Write(Json); Response.End(); }
/// <summary> /// 数据查询 /// </summary> /// <param name="Sql"></param> /// <returns></returns> public static DataSet GetDataSet(string Sql) { DataSet DS = new DataSet(); using (SqlConnection _Conn = new BLL_Document().Connection as SqlConnection) { _Conn.Open(); using (SqlCommand _Cmd = new SqlCommand(Sql, _Conn)) { using (SqlDataAdapter _Adp = new SqlDataAdapter(_Cmd)) { _Adp.Fill(DS); } } _Conn.Close(); _Conn.Dispose(); } return(DS); }
/// <summary> /// 获取人员信息 /// </summary> public string GetPerson() { string TestRoomCode = "TestRoomCode".RequestStr(); string Sql = @" SELECT Ext1 Name,Ext5 Job FROM dbo.sys_document a JOIN dbo.v_bs_codeName b ON a.ModuleID='08899BA2-CC88-403E-9182-3EF73F5FB0CE' AND a.TestRoomCode=b.试验室编码 JOIN dbo.Sys_Tree c ON LEFT(a.TestRoomCode,12)=c.NodeCode where a.TestRoomCode = '{0}' Order By OrderID,TestRoomCode ASC"; Sql = string.Format(Sql, TestRoomCode); BLL_Document Bll = new BLL_Document(); DataTable DT = Bll.GetDataTable(Sql); return(JsonConvert.SerializeObject(DT)); }
private void Chart() { if ("Act".RequestStr() != "Chart") { return; } int ntype = 1; BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetProcDataTableChartsPara5("spweb_failreport_chart_order", "StartDate".RequestStr(), DateTime.Parse("EndDate".RequestStr()).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes, 1); if (dt != null) { List <ChartModel> list = new List <ChartModel>(); foreach (DataRow dr in dt.Rows) { ChartModel trcs = new ChartModel(); if (ntype == 1) { trcs.Description = dr["segment"].ToString() + "\n" + dr["company"].ToString(); trcs.Para1 = dr["companycode"].ToString(); trcs.IntNumber = Int32.Parse(dr["totalncount"].ToString()); trcs.IntNumberMarks = Int32.Parse(dr["counts"].ToString()); trcs.DoubleNumber = Double.Parse(dr["prenct"].ToString()); trcs.FloatNumber1 = Int32.Parse(dr["uncounts"].ToString()); } else if (ntype == 2) { trcs.Description = dr["segment"].ToString() + "\n" + dr["company"].ToString() + "\n" + dr["testroom"].ToString(); trcs.IntNumber = Int32.Parse(dr["totalncount"].ToString()); trcs.IntNumberMarks = Int32.Parse(dr["counts"].ToString()); trcs.DoubleNumber = Double.Parse(dr["prenct"].ToString()); } list.Add(trcs); } Response.Write(JsonConvert.SerializeObject(list)); } else { Response.Write(""); } Response.End(); }
private String qxzlhzbcharttogrid(String proc, int ftype, String testcode, String modelid, out int pageCount, out int records) { BLL_Document BLL = new BLL_Document(); sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line; //if (sysBaseLine.IsActive == 0) //{ testcode = GetSelectTree(testcode, SelectedTestRoomCodes); //} DataTable dt = BLL.GetProcDataTable(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), testcode, modelid, ftype, PageIndex, PageSize, OrderField, OrderType, out pageCount, out records); if (dt != null) { return(JsonConvert.SerializeObject(dt)); } else { return(""); } }
private String qxzlhzb(String proc, int ftype, out int pageCount, out int records) { BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetProcDataTable(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes, ftype, PageIndex, PageSize, OrderField, OrderType, out pageCount, out records); #region 添加总数 int pageCount1 = 0; int records1 = 0; string SelectedTestRoomCodes1 = ""; foreach (DataRow Dr in dt.Rows) { SelectedTestRoomCodes1 += string.IsNullOrEmpty(SelectedTestRoomCodes1) ? "'" + Dr["testcode"].ToString() + "'" : ",'" + Dr["testcode"].ToString() + "'"; } DataTable dt1 = BLL.GetProcDataTable(proc, DateTime.Parse("1999-1-1").ToString("yyyy-MM-dd"), DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes1, ftype, 1, 1000, OrderField, OrderType, out pageCount1, out records1); //testcode modelid dt.Columns.Add(new DataColumn("ncountA", typeof(string))); dt.Columns.Add(new DataColumn("wncountA", typeof(string))); DataTable _tempTable = new DataTable(); foreach (DataRow Dr in dt.Rows) { dt1.DefaultView.RowFilter = " testcode='" + Dr["testcode"].ToString() + "' AND modelid='" + Dr["modelid"].ToString() + "' "; _tempTable = dt1.DefaultView.ToTable(); Dr["ncountA"] = _tempTable.Rows.Count > 0 ? _tempTable.Rows[0]["ncount"].ToString() : ""; Dr["wncountA"] = _tempTable.Rows.Count > 0 ? _tempTable.Rows[0]["wncount"].ToString() : ""; dt1.DefaultView.RowFilter = ""; } #endregion if (dt != null) { return(JsonConvert.SerializeObject(dt)); } else { return(""); } }
private String loginlogpop(string proc, string testcode) { BLL_Document BLL = new BLL_Document(); DataTable dt = BLL.GetProcDataTableChartsPara5(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), testcode, 1); if (dt != null) { List <ChartModel> list = new List <ChartModel>(); foreach (DataRow dr in dt.Rows) { ChartModel trcs = new ChartModel(); trcs.Description = dr["UserName"].ToString(); trcs.DescriptionDate = DateTime.Parse(dr["FirstAccessTime"].ToString()); trcs.DescriptionDate1 = DateTime.Parse(dr["LastAccessTime"].ToString()); list.Add(trcs); } return(JsonConvert.SerializeObject(list)); } else { return(""); } }
/// <summary> /// 获取数据库实体 /// </summary> public void GetObj() { string Sql = @" select * from sys_KeyModify where KMID = '" + "ID".RequestStr() + "' "; BLL_Document BLL = new BLL_Document(); using (IDataReader Read = BLL.ExcuteReader(Sql)) { try { Read.Read(); Obj.KMID = Read["KMID"].ToString(); Obj.Person = Read["YZUserName"].ToString(); Obj.Content = Read["YZContent"].ToString(); Obj.ModifyTime = Read["YZOPTime"].ToString(); } catch { } Read.Close(); Read.Dispose(); } }