public static void CreatRiZhi(PJ_jsbpjjh obj) { PJ_gzrjnr gzr = new PJ_gzrjnr(); gzr.gzrjID = gzr.CreateID(); gzr.ParentID = obj.ID; Thread.Sleep(new TimeSpan(100000));//0.1毫秒 IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "'"); if (gzrj01.Count > 0) { gzr.gzrjID = gzrj01[0].gzrjID; } else { PJ_01gzrj pj = new PJ_01gzrj(); pj.gzrjID = pj.CreateID(); pj.GdsCode = MainHelper.User.OrgCode; pj.GdsName = MainHelper.User.OrgName; pj.CreateDate = DateTime.Now; pj.CreateMan = MainHelper.User.UserName; gzr.gzrjID = pj.gzrjID; pj.rq = DateTime.Now.Date; 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<PJ_01gzrj>(pj); } IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where gzrjID = '" + gzr.gzrjID + "' order by seq "); if (gzrlist.Count > 0) { gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1; } else gzr.seq = 1; PJ_gzrjnr gzrtemp = MainHelper.PlatformSqlMap.GetOne<PJ_gzrjnr>( "where gznr = '生产部制定评级计划' and gzrjID = '" + gzr.gzrjID + "'order by seq "); if (gzrtemp == null) { gzr.gznr = "生产部制定评级计划"; gzr.fzr = "生产局长"; gzr.cjry = "生产局长、生产部主任、总工、配电、变电专责"; gzr.CreateDate = DateTime.Now; gzr.CreateMan = MainHelper.User.UserName; gzr.fssj = DateTime.Now; MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr); } }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(PJ_jsbpjjh 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; }
void gridViewOperation_AfterAdd(PJ_jsbpjjh newobj) { if (isWorkflowCall) { WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns(); mrwt.ModleRecordID = newobj.ID; mrwt.RecordID = currRecord.ID; mrwt.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString(); mrwt.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString(); mrwt.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString(); mrwt.ModleTableName = newobj.GetType().ToString(); mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(); mrwt.CreatTime = DateTime.Now; MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt); //currRecord.DocContent = newobj.BigData; MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord); } CreatRiZhi(newobj); }