public static void CreatRiZhi(sdjl_02aqhd obj) { sdjl_gzrjnr gzr = new sdjl_gzrjnr(); gzr.gzrjID = gzr.CreateID(); gzr.ParentID = obj.ID; Thread.Sleep(new TimeSpan(100000));//0.1毫秒 IList<sdjl_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<sdjl_01gzrj>("Selectsdjl_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + obj.kssj.ToString("yyyy-MM-dd 00:00:00") + "' and '" + obj.kssj.ToString("yyyy-MM-dd 23:59:59") + "'"); if (gzrj01.Count > 0) { gzr.gzrjID = gzrj01[0].gzrjID; } else { sdjl_01gzrj pj = new sdjl_01gzrj(); pj.gzrjID = pj.CreateID(); pj.GdsCode = obj.OrgCode; pj.GdsName = obj.OrgName; pj.CreateDate = obj.kssj; pj.CreateMan = MainHelper.User.UserName; gzr.gzrjID = pj.gzrjID; pj.rq = obj.kssj; pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek); pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days; pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days; Thread.Sleep(new TimeSpan(100000));//0.1毫秒 MainHelper.PlatformSqlMap.Create<sdjl_01gzrj>(pj); } IList<sdjl_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<sdjl_gzrjnr>("Selectsdjl_gzrjnrList", "where gzrjID = '" + gzr.gzrjID + "' order by seq "); if (gzrlist.Count > 0) { gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1; } else gzr.seq = 1; gzr.gznr = "安全活动"; gzr.fzr = obj.zcr; string[] strli = obj.cjry.Split(';'); if (strli.Length < 3) gzr.cjry = obj.cjry; else { gzr.cjry = strli[0] + strli[1] + "等" + strli.Length + "人"; } gzr.CreateDate = obj.kssj; gzr.CreateMan = MainHelper.User.UserName; gzr.fssj = obj.kssj; MainHelper.PlatformSqlMap.Create<sdjl_gzrjnr>(gzr); }
void gridViewOperation_AfterAdd(sdjl_02aqhd obj) { CreatRiZhi(obj); }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(sdjl_02aqhd newobj) { if (parentID == null) return; newobj.OrgCode = parentID; newobj.OrgName = parentObj.OrgName; newobj.CreateDate = DateTime.Now; Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin(); newobj.CreateMan = m_UserBase.RealName; newobj.kssj = DateTime.Now; newobj.jssj = DateTime.Now; newobj.qzrq = DateTime.Now; }