C#
七分钟的旅程
这个作者很懒,什么都没留下…
展开
-
解析GUID逗号分隔的字段
string[] branchlist = Branch.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);原创 2020-03-06 14:39:50 · 234 阅读 · 0 评论 -
C#正则表达式判断字符是否为decimal类型
转载参考:https://blog.csdn.net/weixin_38211198/article/details/90552852\转载:https://blog.csdn.net/guanghuichenshao/article/details/80454185转载:http://blog.sina.com.cn/s/blog_60122cd80100r4g1.html案例...原创 2019-12-19 10:15:33 · 2262 阅读 · 0 评论 -
C#前端遍历后台传过的集合遍历输出
参考https://blog.csdn.net/u010913106/article/details/51372583if ($("#AttachmentfileSavePath").html() != "") { $.ajax({ type: "post", url: "/Admin/BaseBranch...原创 2019-12-16 16:28:45 · 739 阅读 · 0 评论 -
Linq升序降序关键字
ascending--升序descending--降序--案例var model2 = from a in db.BaseBranch where a.GFBranchId == _userInfo.ProjectId orderby a.CreatedDate desc...原创 2019-11-18 11:46:53 · 982 阅读 · 0 评论 -
webconfig中如何引用外部配置文件
在web.config里面添加<configuration><appSettings configSource="WebAppSettings.config" />//WebAppSettings配置文件名字</configuration>代码中如何引用原创 2019-11-18 09:54:34 · 110 阅读 · 0 评论 -
接口request请求体实例化转换
var response = new SysUserOneResponse(); try { var req = JsonConvert.DeserializeObject<Request>(request); if (!IsValidate(req.K, req.S, r...原创 2019-11-13 19:06:12 · 365 阅读 · 0 评论 -
各种非空判断
orderList.DestinationName = nodedesobj != null ? nodedesobj.Name : " ";orderList[i].Customer = customerobj == null ? "" : customerobj.Name;list<class>ServerList; 也可以是var serverlistif(Serv...原创 2019-11-04 09:43:40 · 376 阅读 · 0 评论 -
各种类型之间的转换
string类型转GuidstringallValues=" 1,2"string[] ids = allValues.Split(',');string 转成guid---> Guid nid = Guid.Parse(ids[i]);string[] 转成list集合在转成var 对应的db对象string[] SelectItems;var branch...原创 2019-10-25 09:22:01 · 177 阅读 · 0 评论 -
@Html.DropDownList下拉简单实用
controlleratmcusomers是dbcontext对应的表ViewBag.CustomerType = new MultiSelectList(db.AtmCustomers.Where(a => a.Deleted == false).OrderBy(a => a.Name).ToList(), "Id", "Name", null); ViewBag.AT...原创 2019-10-23 17:53:46 · 681 阅读 · 0 评论 -
string类型转换GUID类型接收
string id=" "; Guid refid = Guid.Empty; int logid = 0; if (!string.IsNullOrEmpty(id)) { if (id.Length > 20) { ...原创 2019-10-23 14:47:15 · 752 阅读 · 0 评论 -
sql servser游标和递归工作中案例
---游标declare @dname nvarchar(255)declare cur cursor for select left(单位,charindex('|',单位)-1) from(select distinct(单位) 单位 from view_sys_data_院内科室) tempopen curfetch next from cur into @dnamewhi...原创 2019-10-05 10:04:14 · 224 阅读 · 0 评论 -
asp.net内置缓存cache在MVC中的存取简单案例
public ActionResult Index() { int id = (int)(Session["User"] as Sys_User).Usr_Id; string cachekey = id.ToString();//可随意输入 List<Cst_Customer> list = (...原创 2019-09-30 12:58:30 · 644 阅读 · 0 评论