工程师职称挂靠,陈佩斯小品赶场,谁有无毒h网
public class importcar { [colname("车牌号")] [regex(regexconstant.not_empty_regex,errormsg ="必填")] [databaseexist("cartable","carcode")] [regex(regexconstant.car_code_regex)] [duplication] public string carcode { get; set; } [colname("手机号")] [regex(regexenum.国内手机号)] public string mobile { get; set; } [colname("身份证号")] [regex(regexconstant.identity_number_regex)] public string identitynumber { get; set; } [colname("姓名")] [maxlength(10)] public string name { get; set; } [colname("性别")] [regex(regexconstant.gender_regex)] public genderenum gender { get; set; } [colname("注册日期")] [datetime] public datetime registerdate { get; set; } [colname("年龄")] [range(0, 150)] public int age { get; set; } }
//校验excel数据 list<exceldatarow> rows = excelimportservice.import<importcar>(fileurl, delegatenotexistindatabase); //错误信息入库 rows.where(r => !r.isvalid).tolist().foreach( r => { inserterrorlog($"第{r.rowindex}行,{r.errormsg}"); } ); //正确数据转换为指定类型 list<importcar> importcars = rows.where(r => r.isvalid).fastconvert<importcar>().tolist(); //正确数据入库 insertcorrectdata(importcars);
[wraptext] [header(color =colorenum.red,fontname ="微软雅黑",fontsize =12,isbold =true)] public class exportcar { [mergecols] [colname("车牌号")] public string carcode { get; set; } [colname("姓名")] public string name { get; set; } [colname("性别")] public genderenum gender { get; set; } [colname("注册日期")] public datetime registerdate { get; set; } [colname("年龄")] public int age { get; set; } }
list<exportcar> list; //业务操作,为list 赋值... ... //导出 iworkbook wk = excelexportservice.export(list); //为iworkbook提供了转换为byte数组的扩展方法 file.writeallbytes(@"c:\test\test.xls", wk.tobytes());
public class wordcar { [placeholder(placeholderenum.a)] public string ownername { get; set; } [placeholder(placeholderenum.b)] public string cartype { get; set; } //图片占位的属性类型必须为list<string>,存放图片的绝对全地址 [pictureplaceholder(placeholderenum.c,"车辆照片")] public list<string> carpictures { get; set; } [pictureplaceholder(placeholderenum.d,"车辆证件")] public list<string> carlicense { get; set; } }
string curdir = environment.currentdirectory; string pic1 = path.combine(curdir, "files", "1.jpg"); string pic2 = path.combine(curdir, "files", "2.jpg"); string pic3 = path.combine(curdir, "files", "3.jpg"); string templateurl = path.combine(curdir, "files", "carword.docx"); wordcar car = new wordcar() { ownername = "张三丰", cartype = "豪华型宾利", carpictures = new list<string> { pic1, pic2 }, carlicense = new list<string> { pic3 } }; xwpfdocument doc = wordexportservice.exportfromtemplate(templateurl, car); ///为xwpfdocument提供了转换为byte数组的扩展方法 file.writeallbytes(@"c:\test\test.docx", doc.tobytes());
github地址:
https://github.com/holdengong/ade.officeservice
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论