private void DoSelect() { CommPowerSplit ps = new CommPowerSplit(); if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName)) { this.PageState.Add("IsCanGrant", "1"); SearchCriterion.SetSearch("IsFixed", "1"); // SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } else { string SQL = @"select * from SysRole As A inner join SysUserRole As B on A.RoleID=B.RoleID where A.Code='PubSurvey' and B.UserId='{0}'"; SQL = string.Format(SQL, UserInfo.UserID); object obj = DataHelper.QueryValue(SQL); if (obj == null) { if (Session["CompanyId"] != null) { string CorpId = Session["CompanyId"].ToString(); CorpId = !string.IsNullOrEmpty(CorpId) ? CorpId : "1007"; SearchCriterion.SetSearch("CompanyId", CorpId); } } SearchCriterion.SetSearch("IsFixed", "1"); // SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } }
private void DoSelect() { CommPowerSplit ps = new CommPowerSplit(); if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName)) { SearchCriterion.SetSearch("IsFixed", "2"); //固定问卷 SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } else { SearchCriterion.SetSearch("IsFixed", "2"); //固定问卷 string CompanyId = string.Empty; //公司ID //first depend login corpid var Ent = SysUser.Find(UserInfo.UserID); UserContextInfo UC = new UserContextInfo(); CompanyId = UC.GetUserCurrentCorpId(UserInfo.UserID); SearchCriterion.AddSearch("CompanyId", CompanyId); SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", Ents); } }
protected void Page_Load(object sender, EventArgs e) { Aim.WorkFlow.Task ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <Aim.WorkFlow.Task>(); ent.Delete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { SysWorkFlowTask.DoBatchDelete(idList.ToArray()); } } else { SearchCriterion.SetSearch("EFormName", this.RequestData["FormId"].ToString(), SearchModeEnum.Like); //SearchCriterion.SetOrder("CreatedTime", true); //SearchCriterion.SetOrder("FinishTime", true); ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion).OrderBy(ens => !ens.FinishTime.HasValue ? DateTime.Now : ens.FinishTime).OrderBy(ens => ens.CreatedTime).ToArray(); this.PageState.Add("SysWorkFlowTaskList", ents); } break; } }
/// <summary> /// 查询 /// </summary> private void DoSelect() { EasyDictionary dic = SysEnumeration.GetEnumDict("EmpAppeal"); dic.Add("%%", "请选择..."); PageState.Add("AppealTypeName", dic); //问卷角色或管理员 CommPowerSplit Role = new CommPowerSplit(); if (Role.IsAppealRole(UserInfo.UserID, UserInfo.LoginName)) { ents = UsrAppealList.FindAll(SearchCriterion); this.PageState.Add("UsrAppealListList", ents); } else { StringBuilder strb = new StringBuilder(); if (Session["CompanyId"] != null) //判断公司登陆 { SearchCriterion.SetSearch(UsrAppealList.Prop_CompanyId, Session["CompanyId"]); ents = UsrAppealList.FindAll(SearchCriterion); this.PageState.Add("UsrAppealListList", ents); } else { var UsrEnt = SysUser.Find(UserInfo.UserID); SearchCriterion.SetSearch(UsrAppealList.Prop_CompanyId, UsrEnt.Pk_corp); ents = UsrAppealList.FindAll(SearchCriterion); this.PageState.Add("UsrAppealListList", ents); } } }
/// <summary> /// 查询 /// </summary> private void DoSelect() { SearchCriterion.SetSearch("CreateId", UserInfo.UserID); SearchCriterion.SetOrder("CreateTime", false); ents = EmpVoiceAskQuestion.FindAll(SearchCriterion); this.PageState.Add("DataList", ents); this.PageState.Add("QuestionEnum", SysEnumeration.GetEnumDict("QuestionType")); }
private void DoSelect() { if (!string.IsNullOrEmpty(SurveyId)) { SearchCriterion.SetSearch("SurveyId", SurveyId); SearchCriterion.SetOrder("CreateWay"); SurveyCanReaderUsr[] SrEnt = SurveyCanReaderUsr.FindAll(SearchCriterion); this.PageState.Add("DataList2", SrEnt); } }
/// <summary> /// 查询 /// </summary> private void DoSelect() { SearchCriterion.SetSearch(UsrAppealList.Prop_UserId, UserInfo.UserID); ents = UsrAppealList.FindAll(SearchCriterion); this.PageState.Add("UsrAppealListList", ents); EasyDictionary dic = SysEnumeration.GetEnumDict("EmpAppeal"); dic.Add("%%", "请选择..."); PageState.Add("AppealTypeName", dic); }
/// <summary> /// 查询 /// </summary> private void DoSelect() { string where = string.Empty; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!String.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { case "CreateTime": where += " year(CreateTime)=" + item.Value + " "; break; } } } SearchCriterion.RemoveSearch("CreateTime"); SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Corp); //公司 SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Indutydate, true); //日期 CommPowerSplit PS = new CommPowerSplit(); SysUser UsrEnt = SysUser.Find(UserInfo.UserID); if (PS.TraveMoneyConfig(UserInfo.UserID, UserInfo.LoginName)) //总部HR权限 HR1 { if (!string.IsNullOrEmpty(where)) { ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where)); this.PageState.Add("TravelMoneyConfigList", ents); } else { ents = TravelMoneyConfig.FindAll(SearchCriterion); this.PageState.Add("TravelMoneyConfigList", ents); } } else { //公司权限 UserContextInfo UC = new UserContextInfo(); SearchCriterion.SetSearch(TravelMoneyConfig.Prop_Corp, UC.GetUserCurrentCorpId(UserInfo.UserID)); if (!string.IsNullOrEmpty(where)) { ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where)); this.PageState.Add("TravelMoneyConfigList", ents); } else { ents = TravelMoneyConfig.FindAll(SearchCriterion); this.PageState.Add("TravelMoneyConfigList", ents); } } }
private void DoSelect() { if (SearchCriterion.Orders.Count == 0) { SearchCriterion.Orders.Add(new OrderCriterionItem("RootCode", true)); SearchCriterion.Orders.Add(new OrderCriterionItem("Code", true)); } string dateFlag = this.RequestData["Date"] == null ? "365" : this.RequestData["Date"].ToString(); switch (dateFlag) { case "3": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(3), SearchModeEnum.LessThanEqual); break; case "7": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(7), SearchModeEnum.LessThanEqual); break; case "14": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(14), SearchModeEnum.LessThanEqual); break; case "30": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual); break; case "31": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual); break; case "180": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(3), SearchModeEnum.LessThanEqual); break; case "365": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddYears(1), SearchModeEnum.LessThanEqual); break; } if (this.RequestData.Get <string>("Status") == "2") { ents = V_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" (DutyId like '%" + this.UserInfo.UserID + "%' or UserIds like '%" + this.UserInfo.UserID + "%')"), Expression.Eq("State", "2")); } else if (this.RequestData.Get <string>("Status") == "1.5") { ents = V_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" (DutyId like '%" + this.UserInfo.UserID + "%' or UserIds like '%" + this.UserInfo.UserID + "%')"), Expression.Eq("State", "1.5")); } else { ents = V_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" (DutyId like '%" + this.UserInfo.UserID + "%' or UserIds like '%" + this.UserInfo.UserID + "%')"), Expression.Not(Expression.In("State", new string[] { "0", "1.5", "2" }))); } PageState.Add("SysWorkFlowTaskList", ents); }
private void DoSelect() { if (string.IsNullOrEmpty(ExamineIndicatorId)) { return; } SearchCriterion.SetSearch(IndicatorFirst.Prop_ExamineIndicatorId, ExamineIndicatorId); SearchCriterion.SetOrder("SortIndex", true); ents = IndicatorFirst.FindAll(SearchCriterion); PageState.Add("DataList", ents); PageState.Add("BeRoleName", SysEnumeration.GetEnumDict("BeExamineObject")); //被考核 }
/// <summary> /// 查询 /// </summary> private void DoSelect() { var UserEnt = SysUser.Find(UserInfo.UserID); string CorpIds = string.Empty; CommPowerSplit ps = new CommPowerSplit(); if (ps.IsNoticeRole(UserInfo.UserID, UserInfo.LoginName)) { ents = UseWelfareNote.FindAll(SearchCriterion); } else { // 判断公司登陆 UserContextInfo UC = new UserContextInfo(); CorpIds = UC.GetUserCurrentCorpId(UserInfo.UserID); SearchCriterion.SetSearch("CreateCorp", CorpIds); ents = UseWelfareNote.FindAll(SearchCriterion); } this.PageState.Add("UseWelfareNoteList", ents); }
protected void Page_Load(object sender, EventArgs e) { cid = RequestData.Get <string>("cid"); SysParameter ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <SysParameter>(); ent.DoDelete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { if (RequestActionString == "batchdelete") { SysParameter.DoBatchDelete(idList.ToArray()); } } break; default: if (!String.IsNullOrEmpty(cid)) { SearchCriterion.SetOrder("SortIndex"); SearchCriterion.SetSearch("CatalogID", cid); ents = SysParameterRule.FindAll(SearchCriterion); this.PageState.Add("SysEnumerationList", ents); } break; } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); string link = RequestData.Get <string>("link"); typeId = RequestData.Get <string>("TypeId", String.Empty); VideoNews ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <VideoNews>(); ent.Delete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: if (this.RequestActionString.ToLower() == "submitnews") { VideoNews ne = VideoNews.Find(this.RequestData["Id"].ToString()); ne.State = this.RequestData["state"].ToString(); ne.Save(); if (this.RequestData["state"].ToString() == "1") { PageState.Add("message", "提交成功"); } else { PageState.Add("message", "收回成功"); } return; } else if (RequestActionString == "batchdelete") { DoBatchDelete(); } break; default: //查看更多 if (link == "home") { string path = DataHelper.QueryValue("select g.Path from SysGroup g inner join sysusergroup ug on ug.GroupId=g.GroupId where UserId='" + UserInfo.UserID + "'") + ""; string sql = @"select n.* from VideoNews n inner join NewsType nt on nt.Id=n.TypeId where TypeId='{2}' and State='2' and isnull(ExpireTime,'2099-01-01')>=getdate() and (charindex('{0}',n.CreateId)>0 or charindex('{0}',n.ReceiveUserId)>0 or charindex('{0}',nt.AllowQueryId)>0 or exists (select Id from Competence c where c.Ext1=n.Id and charindex(PId,'{1}')>0) or exists (select Id from Competence c where c.Ext1=nt.Id and charindex(PId,'{1}')>0))"; sql = string.Format(sql, UserInfo.UserID, path, typeId); PageState.Add("DataList", GetPageData(sql, SearchCriterion)); } else { string where = " and isnull(ExpireTime,'2099-01-01')>=getdate() "; if (RequestData.Get <string>("Expire") == "true") { where = " and isnull(ExpireTime,'2099-01-01')<getdate() "; } foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!String.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { default: where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; break; } } } SearchCriterion.SetSearch("TypeId", typeId); ents = VideoNews.FindAll(SearchCriterion, Expression.Sql(" CreateId = '" + UserInfo.UserID + "' " + where)).OrderByDescending(o => o.CreateTime).ToArray(); this.PageState.Add("DataList", ents); } break; } if (!IsAsyncRequest) { NewsType[] types = NewsType.FindAll(); Dictionary <string, string> dt = new Dictionary <string, string>(); foreach (NewsType type in types) { dt.Add(type.Id, type.TypeName); } this.PageState.Add("EnumType", dt); } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); typeId = RequestData.Get <string>("TypeId", String.Empty); switch (RequestActionString) { case "batchdelete": IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { NewsRule.BatchRemoveByPrimaryKeys(idList); foreach (object obj in idList) { ImgNewDetail.DeleteAll(" PId='" + obj + "' "); VideoNewDetail.DeleteAll(" PId='" + obj + "' "); string delsql = "delete WorkflowInstance where RelateId='" + obj + "' delete Task where EFormName like '%" + obj + "%'"; DataHelper.ExecSql(delsql); } ImgNews.DoBatchDelete(idList.ToArray()); VideoNews.DoBatchDelete(idList.ToArray()); } break; case "submitnews": object news = null; string NewsType = RequestData.Get <string>("NewsType"); if (NewsType == "视频") { ne = VideoNews.Find(this.RequestData["Id"].ToString()); ne.State = this.RequestData["state"].ToString(); ne.Save(); news = ne; } else if (NewsType == "图片") { imgnew = ImgNews.Find(this.RequestData["Id"].ToString()); imgnew.State = this.RequestData["state"].ToString(); imgnew.Save(); news = imgnew; } else { ent = News.Find(this.RequestData["Id"].ToString()); ent.State = this.RequestData["state"].ToString(); ent.Save(); news = ent; } if (this.RequestData["state"].ToString() == "1") { PageState.Add("message", "提交成功"); } else { string nid = ""; if (news is News) { ent = news as News; ent.WFState = ""; ent.WFResult = ""; ent.Update(); nid = ent.Id; } else if (news is ImgNews) { ImgNews imgent = news as ImgNews; imgent.WFState = ""; imgent.WFResult = ""; imgent.Update(); nid = imgent.Id; } else if (news is VideoNews) { VideoNews videoent = news as VideoNews; videoent.WFState = ""; videoent.WFResult = ""; videoent.Update(); nid = videoent.Id; } string delsql = "delete WorkflowInstance where RelateId='" + nid + "' delete Task where EFormName like '%" + nid + "%'"; DataHelper.ExecSql(delsql); PageState.Add("message", "收回成功"); } break; case "submit": StartFlow(RequestData.Get <string>("id")); break; case "autoexecute": Task[] tasks = Task.FindAllByProperties(Task.Prop_WorkflowInstanceID, this.RequestData.Get <string>("FlowId")); if (tasks.Length == 0) { System.Threading.Thread.Sleep(1000); tasks = Task.FindAllByProperties(Task.Prop_WorkflowInstanceID, this.RequestData.Get <string>("FlowId")); } if (tasks.Length > 0) { this.PageState.Add("TaskId", tasks[0].ID); string AuditUserId = RequestData.Get <string>("AuditUserId"); string AuditUserName = RequestData.Get <string>("AuditUserName"); if (!string.IsNullOrEmpty(AuditUserId)) { Aim.WorkFlow.WorkFlow.AutoExecute(tasks[0], new string[] { AuditUserId, AuditUserName }); } else { PageState.Add("error", "自动提交申请人失败,请手动提交"); } } else { PageState.Add("error", "自动提交申请人失败,请手动提交"); } break; case "CancelFlow": string id = RequestData.Get <string>("id"); string NId = ""; ent = News.TryFind(id); if (ent != null) { NId = ent.Id; } else { imgnew = ImgNews.TryFind(id); if (imgnew != null) { NId = imgnew.Id; } } if (DataHelper.QueryDataTable("Select Id from Task where EFormName like '%" + NId + "%' and OwnerId='" + this.UserInfo.UserID + "' and Status=0 ").Rows.Count == 0) { PageState.Add("error", "单据未打回给您或未启动流程,不能作废!"); } else { if (ent != null) { ent.WFState = ""; ent.WFResult = "已撤销"; ent.Update(); } else if (imgnew != null) { imgnew.WFState = ""; imgnew.WFResult = "已撤销"; imgnew.Update(); } string delsql = "delete WorkflowInstance where RelateId='" + NId + "' delete Task where EFormName like '%" + NId + "%'"; DataHelper.ExecSql(delsql); } break; default: PageState.Add("WorkFlowState", SysEnumeration.GetEnumDict("WorkFlowState")); if (op == "r") { string path = DataHelper.QueryValue("select g.Path from SysGroup g inner join sysusergroup ug on ug.GroupId=g.GroupId where UserId='" + UserInfo.UserID + "'") + ""; string sql = @"select n.Id, n.TypeId, n.BelongDeptId, n.Title, n.KeyWord, n.Content, n.ContentType, n.AuthorName, n.PostUserId, n.PostUserName, n.PostDeptId, n.PostDeptName, n.ReceiveDeptId, n.ReceiveDeptName, n.ReceiveUserId, n.ReceiveUserName, n.PostTime, n.ExpireTime, n.SaveTime, n.Pictures, n.Attachments, n.MHT, n.State, n.ImportantGrade, n.ReadCount, n.HomePagePopup, n.LinkPortalImage, n.Class, n.PopupIds, n.Grade, n.AuthorId, n.CreateTime, n.CreateId, n.CreateName, n.Type, n.ReleaseState, n.PId, n.SubmitState, n.NewType, n.ReadState, n.RemindDays, n.RdoType, n.FileType, n.MhtFile from News n inner join NewsType nt on nt.Id=n.TypeId where TypeId='{2}' and State='2' and isnull(ExpireTime,'2099-01-01')>=getdate() and (charindex('{0}',n.ReceiveUserId)>0 or charindex('{0}',n.AuthorId)>0 or charindex('{0}',nt.AllowQueryId)>0 or exists (select Id from Competence c where c.Ext1=n.Id and charindex(PId,'{1}')>0) or exists (select Id from Competence c where c.Ext1=nt.Id and charindex(PId,'{1}')>0)) {3}"; //合并老系统的新闻和公告 if (typeId == "fa67b910-a692-4df7-83a2-50711ba4bfa5" || typeId == "eb9db227-6adc-4dd1-8783-467aadc2d11b") { if (typeId == "fa67b910-a692-4df7-83a2-50711ba4bfa5") { sql += @" union all select [Id],'fa67b910-a692-4df7-83a2-50711ba4bfa5' [CatalogId],[BelongDeptId],[Title],[KeyWord],[Content],[ContentType] ,[AuthorName],[PostUserId],[PostUserName],[PostDeptId],[PostDeptName] ,[ReceiveDeptId],[ReceiveDeptName],[ReceiveUserId],[ReceiveUserName] ,[PostTime],[ExpireTime],[SaveTime],[Pictures],[Attachments],[MHT] ,2,[ImportantGrade],[ReadCount],[HomePagePopup],[LinkPortalImage], '' s,[PopupIds],[Grade],'' authorid,null createtime,null createid,null t,class,null a,null b,null c,null d,null e,null f,null g,null h,null i from BJKY_BeOfficeAuto..PublicInformation WHERE CatalogId = 'OPIC0020' and state=1 {3}"; } else { sql += @" union all select [Id],'eb9db227-6adc-4dd1-8783-467aadc2d11b' [CatalogId],[BelongDeptId],[Title],[KeyWord],[Content],[ContentType] ,[AuthorName],[PostUserId],[PostUserName],[PostDeptId],[PostDeptName] ,[ReceiveDeptId],[ReceiveDeptName],[ReceiveUserId],[ReceiveUserName] ,[PostTime],[ExpireTime],[SaveTime],[Pictures],[Attachments],[MHT] ,2,[ImportantGrade],[ReadCount],[HomePagePopup],[LinkPortalImage], '' s,[PopupIds],[Grade],'' authorid,null createtime,null createid,null t,class,null a,null b,null c,null d,null e,null f,null g,null h,null i from BJKY_BeOfficeAuto..PublicInformation WHERE CatalogId = 'OPIC0021' and state=1 {3}"; } } string where = ""; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (item.Value + "" != "") { where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; } } sql = string.Format(sql, UserInfo.UserID, path, typeId, where); PageState.Add("SysUserList", GetPageData(sql, SearchCriterion)); } else { string where = " and isnull(ExpireTime,'2099-01-01')>=getdate() "; if (RequestData.Get <string>("Expire") == "true") { where = " and isnull(ExpireTime,'2099-01-01')<getdate() "; } foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (item.Value + "" != "") { where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; } } if (!string.IsNullOrEmpty(typeId)) { SearchCriterion.SetSearch("TypeId", typeId); News[] ents = NewsRule.FindAll(SearchCriterion, Expression.Sql(" AuthorId = '" + UserInfo.UserID + "' " + where)).OrderByDescending(o => o.SaveTime).ToArray(); this.PageState.Add("SysUserList", ents); } //图片新闻、视频新闻 不需要过滤(不同的页面) else { string sql = @"select * from (select Id, TypeId, Title, AuthorId, AuthorName, PostDeptId,ReadCount, PostDeptName, PostTime, ExpireTime, SaveTime, [State],'普通' as NewsType, AuditUserId, AuditUserName, WFState, WFResult, (select top 1 ApprovalNodeName from task where [Status]='0' and EFormName like '%'+News.Id+'%') as WFCurrentNode from News union all select Id, TypeId, Title, CreateId,CreateName, PostDeptId,Ext1, PostDeptName, PostTime, ExpireTime, CreateTime, [State],'图片', AuditUserId, AuditUserName, WFState, WFResult, (select top 1 ApprovalNodeName from task where [Status]='0' and EFormName like '%'+ImgNews.Id+'%') as WFCurrentNode from ImgNews union all select Id, TypeId, Title, CreateId,CreateName, PostDeptId,Ext1, PostDeptName, PostTime, ExpireTime, CreateTime, [State],'视频', AuditUserId, AuditUserName, WFState, WFResult, (select top 1 ApprovalNodeName from task where [Status]='0' and EFormName like '%'+VideoNews.Id+'%') as WFCurrentNode from VideoNews) t "; this.PageState.Add("SysUserList", GetPageData(sql + " where AuthorId = '" + UserInfo.UserID + "' " + where, SearchCriterion)); } } break; } if (!IsAsyncRequest) { NewsType[] types = NewsType.FindAll(); Dictionary <string, string> dt = new Dictionary <string, string>(); foreach (NewsType type in types) { dt.Add(type.Id, type.TypeName); } PageState.Add("EnumType", dt); } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); typeId = RequestData.Get <string>("TypeId", String.Empty); News ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <News>(); ent.Delete(); break; case RequestActionEnum.Custom: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { NewsRule.BatchRemoveByPrimaryKeys(idList); foreach (object obj in idList) { ImgNewDetail.DeleteAll(" PId='" + obj + "' "); VideoNewDetail.DeleteAll(" PId='" + obj + "' "); } ImgNews.DoBatchDelete(idList.ToArray()); VideoNews.DoBatchDelete(idList.ToArray()); } } else if (this.RequestActionString.ToLower() == "submitnews") { string NewsType = RequestData.Get <string>("NewsType"); if (NewsType == "视频") { VideoNews ne = VideoNews.Find(this.RequestData["Id"].ToString()); ne.PostTime = DateTime.Now; ne.State = this.RequestData["state"].ToString(); string state = this.RequestData["state"] + ""; if (state == "2") { ne.PostUserId = UserInfo.UserID; ne.PostUserName = UserInfo.Name; ne.PostTime = DateTime.Now; PageState.Add("message", "发布成功"); } else if (state == "0") { PageState.Add("message", "退回成功"); } else { ne.PostUserId = ""; ne.PostUserName = ""; ne.PostTime = null; PageState.Add("message", "撤销成功"); } ne.Save(); } else if (NewsType == "图片") { ImgNews ne = ImgNews.Find(this.RequestData["Id"].ToString()); ne.PostTime = DateTime.Now; ne.State = this.RequestData["state"].ToString(); string state = this.RequestData["state"] + ""; if (state == "2") { ne.PostUserId = UserInfo.UserID; ne.PostUserName = UserInfo.Name; ne.PostTime = DateTime.Now; PageState.Add("message", "发布成功"); } else if (state == "0") { PageState.Add("message", "退回成功"); } else { ne.PostUserId = ""; ne.PostUserName = ""; ne.PostTime = null; PageState.Add("message", "撤销成功"); } ne.Save(); } else { News ne = News.Find(this.RequestData["Id"].ToString()); ne.PostTime = DateTime.Now; ne.State = this.RequestData["state"].ToString(); string state = this.RequestData["state"] + ""; if (state == "2") { ne.PostUserId = UserInfo.UserID; ne.PostUserName = UserInfo.Name; ne.PostTime = DateTime.Now; PageState.Add("message", "发布成功"); } else if (state == "0") { PageState.Add("message", "退回成功"); } else { ne.PostUserId = ""; ne.PostUserName = ""; ne.PostTime = null; PageState.Add("message", "撤销成功"); } ne.Save(); } return; } break; default: string where = " and isnull(ExpireTime,'2099-01-01')>=getdate() "; if (RequestData.Get <string>("checkstate") == "0") { where += " and State='1' "; } else { where += " and State='2' "; } if (RequestData.Get <string>("Expire") == "true") { where = " and isnull(ExpireTime,'2099-01-01')<getdate() "; } foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!String.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { default: where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; break; } } } if (RequestData.Get <string>("checktype") == "Dept") { string sql = @"select top 1 [Path] from View_SysUserGroup where UserId='" + UserInfo.UserID + "' order by Type desc"; where += " and '" + (DataHelper.QueryValue(sql) + "") + "' like '%'+PostDeptId+'%'"; } if (!string.IsNullOrEmpty(typeId)) { SearchCriterion.SetSearch("TypeId", typeId); ents = NewsRule.FindAll(SearchCriterion, Expression.Sql(" (State='1' or State='2') " + where)).OrderByDescending(o => o.SaveTime).ToArray(); this.PageState.Add("SysUserList", ents); } //图片新闻、视频新闻 不需要过滤(不同的页面) else { string sql = @"select * from (select Id, TypeId, Title, AuthorName, PostDeptId,ReadCount, PostDeptName, PostTime, ExpireTime, SaveTime, [State],'普通' as NewsType from News union all select Id, TypeId, Title, CreateName, PostDeptId,Ext1, PostDeptName, PostTime, ExpireTime, CreateTime, [State],'图片' from ImgNews union all select Id, TypeId, Title, CreateName, PostDeptId,Ext1, PostDeptName, PostTime, ExpireTime, CreateTime, [State],'视频' from VideoNews) t "; this.PageState.Add("SysUserList", GetPageData(sql + " where 1=1 " + where, SearchCriterion)); } break; } if (!IsAsyncRequest) { NewsType[] types = NewsType.FindAll(); Dictionary <string, string> dt = new Dictionary <string, string>(); foreach (NewsType type in types) { dt.Add(type.Id, type.TypeName); } this.PageState.Add("EnumType", dt); } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); typeId = RequestData.Get <string>("TypeId", String.Empty); VideoNews ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <VideoNews>(); ent.Delete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: //启动流程 if (this.RequestActionString.ToLower() == "startflow") { VideoNews ne = VideoNews.Find(this.RequestData["Id"].ToString()); //启动流程 string key = "NewsPub"; //表单路径,后面加上参数传入 string formUrl = "/Modules/PubNews/NewsEdit.aspx?op=u&&Id=" + ne.Id; Aim.WorkFlow.WorkFlow.StartWorkFlow(ne.Id, formUrl, ne.Title, key, this.UserInfo.UserID, this.UserInfo.Name); PageState.Add("message", "启动成功"); return; } else if (RequestActionString == "batchdelete") { DoBatchDelete(); } else if (this.RequestActionString.ToLower() == "submitnews") { VideoNews ne = VideoNews.Find(this.RequestData["Id"].ToString()); ne.PostTime = DateTime.Now; ne.State = this.RequestData["state"].ToString(); string state = this.RequestData["state"] + ""; if (state == "2") { ne.PostUserId = UserInfo.UserID; ne.PostUserName = UserInfo.Name; ne.PostTime = DateTime.Now; PageState.Add("message", "发布成功"); } else if (state == "0") { PageState.Add("message", "退回成功"); } else { ne.PostUserId = ""; ne.PostUserName = ""; ne.PostTime = null; PageState.Add("message", "撤销成功"); } ne.Save(); return; } break; default: string where = " and isnull(ExpireTime,'2099-01-01')>=getdate() "; if (RequestData.Get <string>("Expire") == "true") { where = " and isnull(ExpireTime,'2099-01-01')<getdate() "; } foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!String.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { default: where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; break; } } } SearchCriterion.SetSearch("TypeId", typeId); ents = VideoNews.FindAll(SearchCriterion, Expression.Sql(" (State='1' or State='2') " + where)).OrderByDescending(o => o.CreateTime).ToArray(); this.PageState.Add("DataList", ents); break; } if (!IsAsyncRequest) { NewsType[] types = NewsType.FindAll(); Dictionary <string, string> dt = new Dictionary <string, string>(); foreach (NewsType type in types) { dt.Add(type.Id, type.TypeName); } this.PageState.Add("EnumType", dt); } }
protected void Page_Load(object sender, EventArgs e) { A_TaskWBS ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <A_TaskWBS>(); ent.Delete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { A_TaskWBS.DoBatchDelete(idList.ToArray()); } } else { SearchCriterion.SetSearch("DutyId", this.UserInfo.UserID); SearchCriterion.SetOrder("SubmitDate", false); string dateFlag = this.RequestData["Date"] == null ? "180" : this.RequestData["Date"].ToString(); switch (dateFlag) { case "3": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-3), SearchModeEnum.GreaterThanEqual); break; case "7": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-7), SearchModeEnum.GreaterThanEqual); break; case "14": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddDays(-14), SearchModeEnum.GreaterThanEqual); break; case "30": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(-1), SearchModeEnum.GreaterThanEqual); break; case "31": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(-1), SearchModeEnum.LessThanEqual); break; case "180": SearchCriterion.SetSearch("SubmitDate", DateTime.Now.AddMonths(3), SearchModeEnum.LessThanEqual); break; } if (this.RequestData.Get <string>("Status") == "0") { ents = A_TaskWBS.FindAll(SearchCriterion, Expression.IsNull("Tag")); } else { ents = A_TaskWBS.FindAll(SearchCriterion, Expression.IsNotNull("Tag")); } this.PageState.Add("SysWorkFlowTaskList", ents); } break; } }
protected void Page_Load(object sender, EventArgs e) { Aim.WorkFlow.Task ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <Aim.WorkFlow.Task>(); ent.DoDelete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { Aim.WorkFlow.Task.DoBatchDelete(idList.ToArray()); } } else if (this.RequestActionString.ToLower() == "startflow") { //启动流程 /*string key = "FirstFlow"; * //表单路径,后面加上参数传入 * string formUrl = "/EPC/PrjBasic/PrjBasicEdit.aspx?op=u"; * Aim.WorkFlow.WorkFlow.StartWorkFlow("", formUrl, "流程的标题", key, this.UserInfo.UserID, this.UserInfo.Name);*/ Aim.WorkFlow.WorkflowTemplate ne = Aim.WorkFlow.WorkflowTemplate.FindAllByProperty("Code", "audit")[0]; //启动流程 string key = "audit"; //表单路径,后面加上参数传入 string formUrl = "/EPC/PrjBasic/PrjBasicEdit.aspx?op=u"; Aim.WorkFlow.WorkFlow.StartWorkFlow(ne.ID, formUrl, ne.TemplateName, key, this.UserInfo.UserID, this.UserInfo.Name); PageState.Add("message", "启动成功"); } else { SearchCriterion.SetSearch("Status", int.Parse(this.RequestData["Status"].ToString())); SearchCriterion.SetSearch("OwnerId", this.UserInfo.UserID); SearchCriterion.SetOrder("CreatedTime", false); string dateFlag = this.RequestData["Date"] == null ? "3" : this.RequestData["Date"].ToString(); switch (dateFlag) { case "3": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-3), SearchModeEnum.GreaterThanEqual); break; case "7": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-7), SearchModeEnum.GreaterThanEqual); break; case "14": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-14), SearchModeEnum.GreaterThanEqual); break; case "30": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.GreaterThanEqual); break; case "31": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.LessThanEqual); break; } ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion); this.PageState.Add("SysWorkFlowTaskList", ents); } break; } }
protected void Page_Load(object sender, EventArgs e) { V_Task ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <V_Task>(); ent.Delete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { Aim.WorkFlow.Task.DoBatchDelete(idList.ToArray()); } } else if (this.RequestActionString.ToLower() == "startflow") { //启动流程 /*string key = "FirstFlow"; * //表单路径,后面加上参数传入 * string formUrl = "/EPC/PrjBasic/PrjBasicEdit.aspx?op=u"; * Aim.WorkFlow.WorkFlow.StartWorkFlow("", formUrl, "流程的标题", key, this.UserInfo.UserID, this.UserInfo.Name);*/ string key = this.RequestData.Get <string>("flowkey"); Aim.WorkFlow.WorkflowTemplate ne = Aim.WorkFlow.WorkflowTemplate.FindAllByProperty("Code", key)[0]; //启动流程 //表单路径,后面加上参数传入 string formUrl = "/WorkFlow/flowdemo.htm"; Aim.WorkFlow.WorkFlow.StartWorkFlow(ne.ID, formUrl, ne.TemplateName, key, this.UserInfo.UserID, this.UserInfo.Name); PageState.Add("message", "启动成功"); } else { if (int.Parse(this.RequestData["Status"].ToString()) == 1) { SearchCriterion.SetSearch("Status", 4); SearchCriterion.SetSearch(V_Task.Prop_FlowStatus, "Processing"); } else if (int.Parse(this.RequestData["Status"].ToString()) == 4) { SearchCriterion.SetSearch("Status", 4); SearchCriterion.SetSearch(V_Task.Prop_FlowStatus, "Completed"); } else { SearchCriterion.SetSearch("Status", int.Parse(this.RequestData["Status"].ToString())); } SearchCriterion.SetSearch("OwnerId", this.UserInfo.UserID); SearchCriterion.SetOrder("CreatedTime", false); string dateFlag = this.RequestData["Date"] == null ? "3" : this.RequestData["Date"].ToString(); switch (dateFlag) { case "3": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-3), SearchModeEnum.GreaterThanEqual); break; case "7": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-7), SearchModeEnum.GreaterThanEqual); break; case "14": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-14), SearchModeEnum.GreaterThanEqual); break; case "30": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.GreaterThanEqual); break; case "31": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.LessThanEqual); break; case "100": SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(100), SearchModeEnum.LessThanEqual); break; } if (int.Parse(this.RequestData["Status"].ToString()) == 0) { // string sql = @"select * from ( //select ID,Title,WorkFlowInstanceId,WorkFlowName,ApprovalNodeName,CreatedTime,FinishTime, //'' RelateName,'' System,'' Type,'' ExecUrl,'' RelateType,'' OwnerUserId from Task where status=0 and OwnerId='{0}') a //union //select * from ( //select Id,TaskName Title,FlowId WorkFlowInstanceId,FlowName WorkFlowName,TaskName ApprovalNodeName,CreateTime,FinishTime,RelateName,System,Type, //ExecUrl,RelateType,OwnerUserId from BJKY_BeAdmin..WfWorkList where (State='New') and IsSign='{0}') b"; string sql = @"select * from ( select ID,Title,WorkFlowInstanceId,WorkFlowName,ApprovalNodeName,CreatedTime,FinishTime, '' RelateName,'' System,'' Type,'' ExecUrl,'' RelateType,'' OwnerUserId from Task where status=0 and OwnerId='{0}') a"; sql = string.Format(sql, this.UserInfo.UserID); this.PageState.Add("SysWorkFlowTaskList", GetPageData(sql, SearchCriterion)); } else { ents = V_Task.FindAll(SearchCriterion); this.PageState.Add("SysWorkFlowTaskList", ents); } } break; } }
protected void Page_Load(object sender, EventArgs e) { A_TaskWBS ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <A_TaskWBS>(); ent.Delete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { A_TaskWBS.DoBatchDelete(idList.ToArray()); } } else if (RequestActionString == "batchsubmit") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { A_TaskWBS[] tents = A_TaskWBS.FindAll(Expression.In("Id", idList.ToArray())); foreach (A_TaskWBS tent in tents) { tent.State = "2"; tent.Save(); } } } else if (RequestActionString == "batchback") { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { A_TaskWBS[] tents = A_TaskWBS.FindAll(Expression.In("Id", idList.ToArray())); foreach (A_TaskWBS tent in tents) { tent.State = "1"; tent.Save(); } } } else { if (SearchCriterion.Orders.Count == 0) { SearchCriterion.Orders.Add(new OrderCriterionItem("PlanEndDate", true)); } string dateFlag = this.RequestData["Date"] == null ? "365" : this.RequestData["Date"].ToString(); switch (dateFlag) { case "3": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(3), SearchModeEnum.LessThanEqual); break; case "7": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(7), SearchModeEnum.LessThanEqual); break; case "14": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddDays(14), SearchModeEnum.LessThanEqual); break; case "30": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual); break; case "31": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(1), SearchModeEnum.LessThanEqual); break; case "180": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddMonths(3), SearchModeEnum.LessThanEqual); break; case "365": SearchCriterion.SetSearch("PlanEndDate", DateTime.Now.AddYears(1), SearchModeEnum.LessThanEqual); break; } if (this.RequestData.Get <string>("Status") == "2") { ents = A_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" ParentId in (select Id from " + db + "..A_TaskWBS where DutyId like '%" + this.UserInfo.UserID + "%' ) and State='2'")); } else { ents = A_TaskWBS.FindAll(SearchCriterion, Expression.Sql(" ParentId in (select Id from " + db + "..A_TaskWBS where DutyId like '%" + this.UserInfo.UserID + "%' ) and State='1.5'"), Expression.IsNotNull("ParentID")); } this.PageState.Add("SysWorkFlowTaskList", ents); } break; } }