public static void GeneratePackageTask(string projectId) { var taskWork = new TaskWork(); taskWork.SourceCode = FlowCode.TempClosure; taskWork.SourceNameENUS = taskWork.SourceCode; taskWork.SourceNameZHCN = taskWork.SourceCode; taskWork.Status = TaskWorkStatus.UnFinish; taskWork.StatusNameZHCN = "任务"; taskWork.StatusNameENUS = "任务"; taskWork.RefID = projectId; taskWork.Id = Guid.NewGuid(); taskWork.CreateTime = DateTime.Now; taskWork.CreateUserAccount = ClientCookie.UserCode; var tempClosure = TempClosureInfo.FirstOrDefault(i => i.ProjectId == projectId); if (tempClosure == null) { return; } taskWork.Title = TaskWork.BuildTitle(projectId, tempClosure.StoreNameENUS, tempClosure.StoreNameZHCN); taskWork.TypeCode = FlowCode.TempClosure_ClosurePackage; taskWork.TypeNameENUS = "Closure Package"; taskWork.TypeNameZHCN = "Closure Package"; taskWork.ReceiverAccount = tempClosure.AssetActorAccount; taskWork.ReceiverNameENUS = tempClosure.AssetActorNameENUS; taskWork.ReceiverNameZHCN = tempClosure.AssetActorNameZHCN; taskWork.Url = string.Format(@"/TempClosure/Main#/ClosurePackage?projectId={0}", projectId); taskWork.StoreCode = tempClosure.USCode; taskWork.ActivityName = "Start"; TaskWork.Add(taskWork); }
public void UpdateType(string projectId, Dictionary type) { var entity = TempClosureInfo.FirstOrDefault(p => p.ProjectId == projectId); using (TransactionScope tranScope = new TransactionScope()) { entity.Type = type.Code; entity.TypeNameENUS = type.NameENUS; entity.TypeNameZHCN = type.NameZHCN; TempClosureInfo.Update(entity); tranScope.Complete(); } }
public void GenerateReopenTask(string projectId) { var taskWork = new TaskWork(); taskWork.SourceCode = FlowCode.TempClosure; taskWork.SourceNameENUS = taskWork.SourceCode; taskWork.SourceNameZHCN = taskWork.SourceCode; taskWork.Status = TaskWorkStatus.UnFinish; taskWork.StatusNameZHCN = "任务"; taskWork.StatusNameENUS = "任务"; taskWork.RefID = projectId; taskWork.Id = Guid.NewGuid(); taskWork.CreateTime = DateTime.Now; taskWork.CreateUserAccount = ClientCookie.UserCode; var tempClosure = TempClosureInfo.FirstOrDefault(i => i.ProjectId == projectId); if (tempClosure == null) { return; } taskWork.Title = TaskWork.BuildTitle(projectId, tempClosure.StoreNameZHCN, tempClosure.StoreNameENUS); taskWork.TypeCode = FlowCode.TempClosure_ReopenMemo; taskWork.TypeNameENUS = "ReopenMemo"; taskWork.TypeNameZHCN = "ReopenMemo"; taskWork.ReceiverAccount = tempClosure.AssetActorAccount; taskWork.ReceiverNameENUS = tempClosure.AssetActorNameENUS; taskWork.ReceiverNameZHCN = tempClosure.AssetActorNameZHCN; taskWork.Url = string.Format(@"/TempClosure/Main#/ReopenMemo?projectId={0}", projectId); taskWork.StoreCode = tempClosure.USCode; taskWork.ActivityName = "Start"; //Re-open Date 前7天发出任务 ScheduleLog.GenerateTaskSchedule(tempClosure.ActualReopenDate.AddDays(-7), taskWork, ClientCookie.UserCode, projectId, FlowCode.TempClosure_ReopenMemo, tempClosure.USCode); }