public static void CreatRiZhi(PJ_sbsjgcxmjhsbb 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; gzr.gznr = "生产部制定升级计划"; gzr.fzr = obj.xsjfzr; gzr.cjry = obj.shr+"、"+obj.tbr; gzr.CreateDate = obj.tbrq; 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_sbsjgcxmjhsbb 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; try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); } catch { } }
void gridViewOperation_AfterAdd(PJ_sbsjgcxmjhsbb 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); }