上一页 1 ··· 3 4 5 6 7 8 9 10 下一页

2021年10月26日

C# 使用枚举替代if else if

摘要: public enum LogLevel { Debug=0, Error=1, Fatal=2, Info=3, Warn=4 } switch (level) { case LogLevel.Debug: logInstance.Debug(message); break; case LogLe 阅读全文

posted @ 2021-10-26 09:53 写个笔记 阅读(248) 评论(0) 推荐(0)

2021年9月15日

C# 把list的数据存到缓存里面,并绑定GridView

摘要: 按照步骤来即可 (本次代码:AlterBatchID) 1、先定义一个List //AlterBatch名字随便定义 private List<AlterBatch> _list { get { return this["_list"] as List<AlterBatch>; } set { th 阅读全文

posted @ 2021-09-15 16:21 写个笔记 阅读(386) 评论(0) 推荐(0)

2021年9月8日

CIMES的一些属性、方法

摘要: //获取当前登录用户 User.Identity.Name //取消进站的API WIPTransaction.UndoLotCheckIn(lot, "Wait", true, txnStamp); //切换到110数据库 //第一种方法 using (var cts = CimesTransac 阅读全文

posted @ 2021-09-08 16:30 写个笔记 阅读(85) 评论(0) 推荐(0)

C# CIMES里面切换数据库(只适用于我们公司的代码)

摘要: //当前页面连接的是170数据库,切换到176数据库 CustomDataAgent dataAgent = DBCenter.Create(Utility.AppSetting.WMSConnection); //查询176数据库的MES_AOI_WO表 string sqlAOIWO = @"S 阅读全文

posted @ 2021-09-08 12:03 写个笔记 阅读(76) 评论(0) 推荐(0)

2021年9月1日

C# 使用NPOI改变excel单元格字体里的颜色

摘要: //先给第14行第0列的单元格赋值 sheet2.CreateRow(14).CreateCell(0).SetCellValue("PS:根据‘测试数据报表’中‘FM’项统计不良比例"); IFont font3 = wookbook1.CreateFont(); font3.Color = HS 阅读全文

posted @ 2021-09-01 16:16 写个笔记 阅读(1092) 评论(0) 推荐(0)

C# 使用NPOI 设置excel的某一列百分比显示

摘要: IWorkbook wookbook1; ISheet sheet2 = wookbook1.CreateSheet("数据统计报表"); for (int j = 1; j < 11; j++) { //如果没有创建行,那么下一行的GetRow就要变成CreateRow //如果已经创建了行,就用 阅读全文

posted @ 2021-09-01 15:07 写个笔记 阅读(931) 评论(0) 推荐(0)

2021年8月31日

SqlServer用like关联两个表中的字段,2个表的前几码相同,但是后几码不相同

摘要: --A表的SN字段和B表的MATSN字段里的数据前几码相同,但是后几码不同(matsn栏位多一码值,例A的SN字段值可能是123456,B表的值是1234567A) --这个查询结果就是查出 A表里的SN栏位的数据 不在B表的MATSN栏位。 select * from #TEMP A where 阅读全文

posted @ 2021-08-31 12:07 写个笔记 阅读(496) 评论(0) 推荐(0)

2021年8月30日

SqlServe 两张表字段值比较,查找不存在的记录

摘要: --比较A和B表的 SN 和 MATSN 2个栏位,并显示出A表SN不存在B表MATSN栏位的结果 select * from #TEMP A where not exists(select MATSN from AOI_MAT_LOT B WHERE A.SN = B.MATSN AND B.IS 阅读全文

posted @ 2021-08-30 16:07 写个笔记 阅读(434) 评论(0) 推荐(0)

2021年8月26日

C# 往combobox里面添加默认选项

摘要: 代码如下 //往cob_class里面添加默认选项,cob_class是combobox控件的名称 ArrayList arrayListclass = new ArrayList(); arrayListclass.Add("请选择"); arrayListclass.Add("光器件一课"); 阅读全文

posted @ 2021-08-26 23:25 写个笔记 阅读(881) 评论(0) 推荐(0)

2021年8月25日

SqlServer 获取特定表中有哪些字段(或者说哪些列),并且按照查表时列名的顺序显示

摘要: --直接把该条语句的AAA_AAA_TRXTEST1改成自己的表就行了 select s.name from syscolumns s where s.id = object_id('AAA_AAA_TRXTEST1') order by s.colid; 阅读全文

posted @ 2021-08-25 09:47 写个笔记 阅读(122) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 下一页

导航