摘要: 背景 目前系统中,有一个服务,此服务用于客户供应商的绩效。服务设计之初,只支持一家客户。 缺点分析 随着客户的增加以及每个客户的处理越来越个性化,原来服务设计已经补满足。此服务一共分为5个步骤。步骤一,步骤二……..,每个步骤出错,可以从上一个步骤继续。每次从当前步骤升级到下一个步骤,需要判断是否能 阅读全文
posted @ 2020-07-10 17:28 小小的菜鸟程序员 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 背景 目前系统中,使用较多的通用选择包括:人员选择,品类选择,供应商选择等。采用的模式,基本上是点击按钮或者不可写的文本框。类似图: 其基本实现,主要是通过调用dialog加载人员选择/品类选择/供应商选择页面。 缺点分析 采用此方法可以满足大多数的应用场景,但是如果当对弹出里的数据进行初始过滤就会 阅读全文
posted @ 2020-07-10 16:52 小小的菜鸟程序员 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 代码如下 1 select from ( 2 select 3 row_number() over(partition by x order by y desc) as rid 4 , 5 from z 6 ) as tt 7 where tt.rid=1 13 --按x分组,以y排序 阅读全文
posted @ 2020-06-11 11:52 小小的菜鸟程序员 阅读(2828) 评论(0) 推荐(1) 编辑
摘要: 转载自大圣的笑 原文链接:https://www.cnblogs.com/mahatmasmile/p/3872784.html /// <summary> /// ASP.NET4.0 表单验证类 /// </summary> public class FormRequestValidation 阅读全文
posted @ 2019-11-15 18:44 小小的菜鸟程序员 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1.背景描述 昨天收到同事反馈,说epplus使用模板导出后,多级联动失效。一时来了兴趣,针对此问题分析,后来发现联动失效并不是epplus使用上的问题,而且此问题出现的主要原因是因为对sheet上的列进行了增加或者减少。 此问题在百度和goole上都找了一下,发现均没有答案。只能自己动手分析了。 阅读全文
posted @ 2019-11-01 11:00 小小的菜鸟程序员 阅读(677) 评论(0) 推荐(0) 编辑
摘要: 1 public class HttpExtend 2 { 3 /// 4 /// 日志 5 /// 6 public static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 7 8 /// 9 /// post提交 Created By... 阅读全文
posted @ 2017-01-20 10:30 小小的菜鸟程序员 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 1 public class Phone 2 { 3 /// 4 /// 日志 5 /// 6 public static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 7 8 9 public static readonly... 阅读全文
posted @ 2017-01-20 10:30 小小的菜鸟程序员 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 1 public class ThreadExtend 2 { 3 public ThreadExtend() 4 { 5 } 6 7 /// 8 /// 线程对象 9 /// 10 protected System.Threading.Thread Th; 11 12 13 public System.Threading.Thread Th... 阅读全文
posted @ 2017-01-20 10:29 小小的菜鸟程序员 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 public class EmailConfig 2 { 3 public static readonly string ServerAddress = ConfigurationManager.AppSettings["ServerAddress"]; 4 public static readonly string ServerUserName = Configuratio... 阅读全文
posted @ 2017-01-20 10:29 小小的菜鸟程序员 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 在原来MemberHelper基础上修正了每次都初始化的问题,增加了对泛型的支持。改用静态构造函数来初始化 ZhangQC 2016.08.15 3 /// 4 public class MemcacheExtend 5 { 6 //日志 7 public static readonly ILog Log = LogManager.GetL... 阅读全文
posted @ 2017-01-20 10:28 小小的菜鸟程序员 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 此类作用:数据仓库,数据基础操作 3 /// 4 /// 实体 5 /// 6 /// zhangqc 2016.08.08 新建 7 /// 8 public partial class Repository : IRepository, IDisposable 9 where TEntity : class 10 { 1... 阅读全文
posted @ 2017-01-20 10:27 小小的菜鸟程序员 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// json操作类 3 /// 4 public static class JsonExtend 5 { 6 /// 7 /// 对象转换为Json 8 /// 9 /// 10 /// 11 public static string ObjToJson(this object sender) 12 { 13 IsoDateTimeConvert... 阅读全文
posted @ 2017-01-20 10:27 小小的菜鸟程序员 阅读(213) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 此类作用:拦截所有经过IOC的方法,日志在Debug模式下记录传入参数,以及产生的错误 /// 日志在Release模式下,只有出错的情况下才会记录传入参数和错误信息 /// </summary> public class ExceptionLogBehavior 阅读全文
posted @ 2017-01-20 10:26 小小的菜鸟程序员 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 此类作用:容器实体,使用App_Data\unity.config文件配置,根据XML配置初始化IOC Created by ZhangQC 2016.08.08 3 /// 4 public partial class IocFactory 5 { 6 /// 7 /// 依赖注入容器 8 /// 9 private sta... 阅读全文
posted @ 2017-01-20 10:26 小小的菜鸟程序员 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 1 public class ImageDraw 2 { 3 public Image NewBitmap(int w, int h, float dpix, float dpiy) 4 { 5 var rt = new Bitmap(w, h); 6 rt.SetResolution(dpix, dpiy); 7 return rt; 8 } 9 10 ... 阅读全文
posted @ 2017-01-20 10:25 小小的菜鸟程序员 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 1 /// 图像处理模式 2 /// 3 public enum ImageSizeMode 4 { 5 /// 原图,不做其他处理 6 /// 7 [CustomAttribute.Custom("原图", "N")] 8 None, 9 10 /// 居中 固定中心 剪裁或者留黑 11 /// 12 [CustomAttribute.C... 阅读全文
posted @ 2017-01-20 10:25 小小的菜鸟程序员 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 执行Sql语句 3 /// 4 public static class DatabaseExtend 5 { 6 /// 7 /// 执行任何SQL语句,通用所有的数据库(SQLServer,MySql,Oracle等),利用EMIT快速反射,得到动态类型实体,支持参数查询,防止sql注入。 Created by ZhangQC 8... 阅读全文
posted @ 2017-01-20 10:22 小小的菜鸟程序员 阅读(1604) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 实现动态排序 3 /// 来源博客园的一个大神,具体实现原理是利用实体和排序字段自动生成一个表达式 4 /// 再利用IQuerable的方法实现 5 /// 有一部分比较像微软的源码 ZhangQC 2016.10.20 6 /// 7 public static class DynamicOrder 8 { 9 #region ... 阅读全文
posted @ 2017-01-20 10:21 小小的菜鸟程序员 阅读(1925) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 本类用来将字符串转为可执行文本并执行 3 /// 做了一部分修改,修改原来的错误,修改,增加了部分逻辑。测试通过,请勿随意修改 ZhangQC 4 /// 5 public class Evaluator 6 { 7 #region 构造函数 8 /// 9 /// 可执行串的构造函数 10 /// 11 /// 12 ... 阅读全文
posted @ 2017-01-20 10:20 小小的菜鸟程序员 阅读(1924) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 在数据仓储的情况下进一步封装数据库基础操作,此版本为异步版本 Created by ZhangQC 2016.08.17 3 /// 4 public static partial class EntityExtend 5 { 6 /// 7 /// 日志 8 /// 9 private static readonly ILog... 阅读全文
posted @ 2017-01-20 10:20 小小的菜鸟程序员 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 所有的枚举扩展 Created By ZhangQC 2016.08.19 3 /// 4 public static class EnumExtend 5 { 6 /// 7 /// 因为使用反射,频繁读取效率不高,故使用静态容器做缓存 Created By ZhangQC 2016.08.19 8 /// 9 private... 阅读全文
posted @ 2017-01-20 10:19 小小的菜鸟程序员 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 自定义特性,比系统的display增加了一些参数 Created by ZhangQC 2015.08.19 3 /// 4 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, 5 AllowMultiple = false, Inherited = false)] 6 p... 阅读全文
posted @ 2017-01-20 10:18 小小的菜鸟程序员 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 自定义比较器 ZhangQC 2016.11.29 3 /// 4 /// 5 /// 6 public class CommonEqualityComparer : IEqualityComparer 7 { 8 private readonly Func _keySelector; 9 10 public CommonEqualityCo... 阅读全文
posted @ 2017-01-20 10:17 小小的菜鸟程序员 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1 public static class CollectionExtend 2 { 3 /// 4 /// 向集合中添加元素 5 /// 6 /// 7 /// 8 /// 9 public static void Add(this IEnumerable collection, T value) 10 { 11 var list = collection as L... 阅读全文
posted @ 2017-01-20 10:15 小小的菜鸟程序员 阅读(1081) 评论(0) 推荐(0) 编辑
摘要: 1 public static class CloneExtend 2 { 3 /// 4 /// 深复制 5 /// 6 /// 7 /// 8 /// 9 public static T DepthClone(this T sender) 10 { 11 //先序列化 12 var objJson = sender.ObjToJson(); 13 //反序列化 1... 阅读全文
posted @ 2017-01-20 10:13 小小的菜鸟程序员 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 此类作用:解决在同步方法中使用异步方法产生的线程死锁 3 /// 死锁的主要原因是因为代码中线程对上下文的争夺 4 /// 5 public static class AsyncExtend 6 { 7 /// 8 /// 同步执行一个void类型的返回值操作 9 /// 10 /// Task method to execu... 阅读全文
posted @ 2017-01-20 10:12 小小的菜鸟程序员 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// HttpRuntime Cache读取设置缓存信息封装 3 /// 使用描述:给缓存赋值使用HttpRuntimeCache.Set(key,value....)等参数(第三个参数可以传递文件的路径(HttpContext.Current.Server.MapPath())) 4 /// 读取缓存中的值使用JObject jObject=HttpRunt... 阅读全文
posted @ 2017-01-20 10:12 小小的菜鸟程序员 阅读(192) 评论(0) 推荐(0) 编辑