protected void Page_Load(object sender, EventArgs e) { switch (RequestActionString) { case "JudgeSkinIsExist": skinNo = RequestData.Get <string>("SkinNo"); if (!string.IsNullOrEmpty(skinNo)) { IList <Skin> skinEnts = Skin.FindAll("from Skin where SkinNo='" + skinNo + "'"); if (skinEnts.Count > 0) { PageState.Add("SkinIsExist", true); } } break; case "batchsave": IList <string> entStrList = RequestData.GetList <string>("data"); if (entStrList != null && entStrList.Count > 0) { IList <Skin> skinEnts = entStrList.Select(tent => JsonHelper.GetObject <Skin>(tent) as Skin).ToList(); foreach (Skin ent in skinEnts) { if (ent != null) { Skin sent = ent; sent.SkinNo = sent.SkinNo.ToUpper(); //将包装编号中的字母转换成大写 if (String.IsNullOrEmpty(sent.Id)) { sent.CreateId = UserInfo.UserID; sent.CreateName = UserInfo.Name; sent.CreateTime = System.DateTime.Now; } else { sent = DataHelper.MergeData(Skin.Find(sent.Id), sent); } sent.DoSave(); // PageState.Add("SkinId", sent.Id); } } } break; default: DoSelect(); break; } }
private void DoSelect() { string where = ""; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!string.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { case "StartTime": where += " and StartTime>='" + item.Value + "' "; break; case "EndTime": where += " and EndTime<='" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' "; break; default: where += " and " + item.PropertyName + " like '%" + item.Value + "%'"; break; } } } sql = @"select Id,GroupName from BJKY_Examine..PersonConfig where (ClerkIds like '%{0}%' or SecondLeaderIds like '%{0}%' or FirstLeaderIds like '%{0}%') and (GroupType='职能服务部门' or GroupType='经营目标单位')"; // sql = @"select * from sysgroup where (parentid='4b54389a-6537-4748-823c-fb55223afbad' or parentid='bde12833-038a-4ec6-bfc9-41f630c70380' // or parentid='3273c49a-1f9b-4328-b54c-d01e39c39edc' or parentid='037f85a8-3777-4015-9bc2-dc5aba4ccb28') and GroupID in // (select GroupID from SysUserGroup where UserID='{0}')"; sql = string.Format(sql, UserInfo.UserID); IList <EasyDictionary> tempDics = DataHelper.QueryDictList(sql); if (tempDics.Count > 0) { if (tempDics[0].Get <string>("GroupName").IndexOf("人力资源") >= 0) { PageState.Add("Remove", "F"); } else { PageState.Add("Remove", "T"); } } sql = @"select * ,(select Count(Id) from BJKY_Examine..ExamineTask where State!='1' and State!='0' and State!='4' and ExamineStageId=ExamineStage.Id) as SubmitQuan from BJKY_Examine..ExamineStage where LaunchDeptId in (select Id from BJKY_Examine..PersonConfig where (ClerkIds like '%{0}%' or SecondLeaderIds like '%{0}%' or FirstLeaderIds like '%{0}%') and (GroupType='职能服务部门' or GroupType='经营目标单位'))" + where; sql = string.Format(sql, UserInfo.UserID); PageState.Add("DataList", GetPageData(sql, SearchCriterion)); }
private void DoSelect() { string where = ""; 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; } } } switch (scoreZone) { case "95->100": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=95" + where; break; case "90->94": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=90 and IntegrationScore < 95" + where; break; case "85->89": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=85 and IntegrationScore < 90" + where; break; case "80->84": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=80 and IntegrationScore < 85" + where; break; case "75->79": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=75 and IntegrationScore < 80" + where; break; case "70->74": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=70 and IntegrationScore < 75" + where; break; case "0->69": sql = @"select * from BJKY_Examine..ExamYearResult where Year='" + year + "' and IntegrationScore>=0 and IntegrationScore < 70" + where; break; } IList <EasyDictionary> dics = DataHelper.QueryDictList(sql); PageState.Add("DataList", GetPageData(sql, SearchCriterion)); }
private void DoSelect() { string where = ""; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!string.IsNullOrEmpty(item.Value.ToString())) { where += " and " + item.PropertyName + " like '%" + item.Value + "%'"; } } string sql = @"select A.*,B.Pcn from SHHG_AimExamine..CombineSplit as A left join SHHG_AimExamine..Products as B on A.ProductId=B.Id where 1=1" + where; PageState.Add("DataList", GetPageData(sql, SearchCriterion)); }
private void DoSelect() { string where = ""; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { where += " and " + item.PropertyName + " like '%" + item.Value + "%'"; } string warehouseId = RequestData.Get <string>("WarehouseId"); string sql = @"select A.*,B.Isbn as ProductIsbn,B.Pcn as ProductPcn,B.ProductType from SHHG_AimExamine..StockInfo as A left join SHHG_AimExamine..Products as B on A.ProductId=B.Id where A.WarehouseId='{0}' " + where; sql = string.Format(sql, warehouseId); PageState.Add("DataList", GetPageData(sql, SearchCriterion)); }
protected void Page_Load(object sender, EventArgs e) { string qryString = "SELECT nt.*, nt.TypeName AS title, ISNULL(n.[Count], 0) AS count FROM NewsType nt LEFT JOIN " + "(SELECT TypeId, COUNT(Id) AS [Count] FROM News WHERE ReceiveUserId LIKE '%" + UserInfo.UserID + "%' GROUP BY TypeId) AS n " + " ON n.TypeId = nt.Id AND AllowQueryId LIKE '%" + UserInfo.UserID + "%'"; DataTable dtNews = Aim.Data.DataHelper.QueryDataTable(qryString); PageState.Add("News", JsonHelper.GetJsonStringFromDataTable(dtNews)); int msgCount = Aim.Data.DataHelper.QueryValue <int>("SELECT COUNT(Id) AS count FROM SysMessage WHERE ReceiverName LIKE '%" + UserInfo.UserID + "%'"); PageState.Add("MsgCount", msgCount); GetUserCreateMoudles(); }
private void DoSelect() { if (according == "Sender") { sql = @"select newid() as Id, CreateId,CreateName,Count(Id) as Quantity from BJKY_SP..IntegratedMessage where ReceiverId='{0}' and State is null group by CreateId,CreateName"; } else { sql = @"select newid() as Id, MessageType,Count(Id) as Quantity from BJKY_SP..IntegratedMessage where ReceiverId='{0}' and State is null group by MessageType "; } sql = string.Format(sql, UserInfo.UserID); PageState.Add("DataList", DataHelper.QueryDictList(sql)); }
public void StartFlow() { ArrayList array = new ArrayList(); string formUrl = "/Task/A_TaskWBSEdit.aspx?op=r&InFlow=T&id=" + id; Guid guid = WorkFlow.StartWorkFlow(id, formUrl, "任务审批", "AimFinishAudit", UserInfo.UserID, UserInfo.Name); A_TaskWBS ptEnt = A_TaskWBS.TryFind(twEnt.ParentID); //获取到上级任务责任人 if (ptEnt != null) { array.Add(guid + "#" + ptEnt.DutyId + "$" + ptEnt.DutyName); PageState.Add("WorkFlowInfo", array); twEnt.State = "1.5"; twEnt.Update(); } }
protected void Page_Load(object sender, EventArgs e) { string purchaseOrderId = RequestData.Get <string>("PurchaseOrderId"); if (!string.IsNullOrEmpty(purchaseOrderId)) { string sql = @"select A.*,B.ProductType from SHHG_AimExamine..PurchaseOrderDetail as A left join SHHG_AimExamine..PurchaseOrder as B on A.PurchaseOrderId=B.Id where B.Id='{0}'"; sql = string.Format(sql, purchaseOrderId); IList <EasyDictionary> dics = DataHelper.QueryDictList(sql); PageState.Add("DetailList", dics); PurchaseOrder poEnt = PurchaseOrder.Find(purchaseOrderId); PageState.Add("PurchaseOrder", poEnt); } }
private void DoSelect() { if (op != "c" && op != "cs") { ent = Vedio.Find(id); SetFormData(ent); sql = @"select * from FileItem where Id='{0}'"; sql = string.Format(sql, ent.VedioFile); PageState.Add("DataList", DataHelper.QueryDictList(sql)); sql = @"select * from FileItem where PatIndex('%'+Id+'%','{0}')>0"; sql = string.Format(sql, ent.ImageFile); PageState.Add("ImageList", DataHelper.QueryDictList(sql)); } PageState.Add("VedioType", SysEnumeration.GetEnumDict("VedioType")); }
protected void Page_Load(object sender, EventArgs e) { string where = ""; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (item.Value.ToString() != "") { where += " and A." + item.PropertyName + " like '%" + item.Value + "%'"; } } string sql = @"select Id,GroupName,CreateTime,GroupType,FirstLeaderNames from BJKY_Examine..PersonConfig where GroupType='职能服务部门' or GroupType='经营目标单位' " + where; PageState.Add("DataList", GetPageData(sql, SearchCriterion)); }
string type = String.Empty; // 对象类型 #endregion #region ASP.NET 事件 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id") == null?RequestData.Get <string>("Id") : RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); WorkflowTemplate ent = null; switch (this.RequestAction) { case RequestActionEnum.Update: ent = this.GetMergedData <WorkflowTemplate>(); ent.DoUpdate(); this.SetMessage("修改成功!"); break; case RequestActionEnum.Insert: case RequestActionEnum.Create: ent = this.GetPostedData <WorkflowTemplate>(); // 设置项目信息 ent.Creator = UserInfo.Name; ent.DoCreate(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <WorkflowTemplate>(); ent.DoDelete(); this.SetMessage("删除成功!"); return; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = WorkflowTemplate.Find(id); } this.SetFormData(ent); } else { PageState.Add("CreateName", UserInfo.Name); PageState.Add("CreateTime", DateTime.Now); } }
private void DoSelect() { if (op != "c" && op != "cs") { ent = ReleaseDocument.Find(id); SetFormData(ent); sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0 and Status='4' and ApprovalNodeName in('部门领导','相关部门会签','院办主任','归口部门会签','主管院长','院办主任核稿','院长审批') order by FinishTime asc"; sql = string.Format(sql, id); IList <EasyDictionary> taskDics = DataHelper.QueryDictList(sql); PageState.Add("Opinion", taskDics); sql = @"select * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0 "; sql = string.Format(sql, ent.ApproveContent); PageState.Add("DataList", DataHelper.QueryDictList(sql)); sql = @"select * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0 "; sql = string.Format(sql, ent.Attachment); PageState.Add("DataList2", DataHelper.QueryDictList(sql)); } else { sql = @"select top 1 case [Type] when 3 then ParentDeptName when 2 then ChildDeptName end as DeptName, case [Type] when 3 then ParentId when 2 then DeptId end as DeptId from View_SysUserGroup where UserId='{0}'"; sql = string.Format(sql, UserInfo.UserID); IList <EasyDictionary> deptDics = DataHelper.QueryDictList(sql); if (deptDics.Count > 0) { var obj = new { CreateDeptId = deptDics[0].Get <string>("DeptId"), CreateDeptName = deptDics[0].Get <string>("DeptName"), CreateId = UserInfo.UserID, CreateName = UserInfo.Name }; SetFormData(obj); } } string taskId = RequestData.Get <string>("TaskId");//取审批暂存时所填写的意见 if (!string.IsNullOrEmpty(taskId)) { Task tEnt = Task.Find(taskId); if (tEnt.Status != 4 && !string.IsNullOrEmpty(tEnt.Description)) { PageState.Add("UnSubmitOpinion", tEnt.Description); } } }
protected void Page_Load(object sender, EventArgs e) { string id = RequestData.Get <string>("id"); switch (RequestActionString) { case "Modify": PageState.Add("result", AllowOperate(id) == true ? "true" : "false"); break; case "batchdelete": IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { foreach (object obj in idList) { bool allowDelete = AllowOperate(obj.ToString()); if (allowDelete) { DataHelper.ExecSql("delete SHHG_AimExamine..PurchaseOrder where Id='" + obj.ToString() + "'"); PurchaseOrderDetail.DeleteAll("PurchaseOrderId='" + obj + "'"); //删除采购订单详细 PageState.Add("Message", "删除成功!"); } else { PageState.Add("Message", "已创建入库单或者付款单的订单不允许删除!"); return; } } } break; default: if (RequestData.Get <string>("optype") == "getChildData") { string purchaseOrderId = RequestData.Get <string>("PurchaseOrderId"); string tempsql = @"select A.*,C.Symbo from SHHG_AimExamine..PurchaseOrderDetail as A left join SHHG_AimExamine..PurchaseOrder as B on A.PurchaseOrderId=B.Id left join SHHG_AimExamine..Supplier as C on B.SupplierId=C.Id where A.PurchaseOrderId='" + purchaseOrderId + "'"; IList <EasyDictionary> dics = DataHelper.QueryDictList(tempsql); PageState.Add("DetailList", dics); } else { DoSelect(); } break; } }
private void DoSelect() { string where = ""; string productType = RequestData.Get <string>("ProductType"); if (!string.IsNullOrEmpty(productType)) { SearchCriterion.AddSearch("ProductType", productType); } foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (item.PropertyName == "BeginDate1" && item.Value + "" != "") { where += " and B.CreateTime>'" + item.Value + "' "; } else if (item.PropertyName == "EndDate1" && item.Value + "" != "") { where += " and B.CreateTime<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' "; } else if (item.PropertyName == "BeginDate" && item.Value + "" != "") { where += " and B.EndDate>'" + item.Value + "' "; } else if (item.PropertyName == "EndDate" && item.Value + "" != "") { where += " and B.EndDate<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' "; } else if (item.Value + "" != "") { where += " and " + item.PropertyName + " like '%" + item.Value + "%' "; } } string sql = @"select A.*,B.Number,B.CName,B.Salesman,B.EndDate,B.InvoiceNumber,C.ProductType,C.Pcn,C.CostPrice, SHHG_AimExamine.dbo.fun_CaculateCostAmount(A.PId,A.Count,A.SalePrice) as CostAmount, (select top(1) Rate from SHHG_AimExamine..ExchangeRate where Symbo =(select top(1) Symbo from SHHG_AimExamine..Supplier where Id=C.SupplierId )) as Rate, SHHG_AimExamine.dbo.fun_CaculateBuyPrice(A.PId) as BuyPrice, B.CreateTime from ( select OId,PId,PCode,PName,Isbn,sum([count]) as [Count],max(SalePrice) as SalePrice, sum(Amount) as Amount from( select OId,PId,PCode,PName,Isbn,([Count]-isnull(ReturnCount,0)) as Count,SalePrice,Amount from SHHG_AimExamine..OrdersPart )t group by PId,PCode,PName,Isbn,OId having sum([Count])>0 ) as A left join SHHG_AimExamine..SaleOrders as B on A.OId=B.Id left join SHHG_AimExamine..Products as C on C.Id=A.PId where (B.DeliveryState is null or B.DeliveryState<>'已作废') and B.InvoiceType='发票' " + where; PageState.Add("OrderList", GetPageData(sql, SearchCriterion)); }
protected void Page_Load(object sender, EventArgs e) { //根据参数设置缩略图片大小 if (!string.IsNullOrEmpty(this.RequestData.Get <string>("ImgDirectory"))) { string imgSize = this.RequestData.Get("ImgDirectory").ToString(); if (imgSize.Split('*').Length > 1) { ImgDirectory = imgSize; } } op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); if (!string.IsNullOrEmpty(id)) { ent = Vedio.Find(id); } switch (RequestActionString) { case "update": ent = GetMergedData <Vedio>(); ent.DoUpdate(); break; case "ImportFile": string fileIds = RequestData.Get <string>("fileIds"); string fileType = Server.UrlDecode(RequestData.Get <string>("FileType")); if (!string.IsNullOrEmpty(fileIds)) { sql = @"select * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0"; sql = string.Format(sql, fileIds); PageState.Add("Result", DataHelper.QueryDictList(sql)); } break; case "create": ent = GetPostedData <Vedio>(); ent.PlayTimes = 0; ent.DoCreate(); VideoToThumbImg(ent); break; default: DoSelect(); break; } }
protected void Page_Load(object sender, EventArgs e) { id = RequestData.Get <string>("id", String.Empty); type = RequestData.Get <string>("type", String.Empty).ToLower(); ctype = RequestData.Get <string>("ctype", "user").ToLower(); if (ctype == "group") { if (!String.IsNullOrEmpty(id)) { ICriterion cirt = null; if (type == "gtype") { cirt = Expression.Sql("UserID IN (SELECT UserID FROM SysUserGroup WHERE GroupID IN (SELECT GroupID FROM SysGroup WHERE Type = ?))", id, NHibernateUtil.String); } else { // 应该同时获取子组用户 cirt = Expression.Sql("UserID IN (SELECT UserID FROM View_SysUserGroup WHERE Path LIKE '%" + id + "%')", id, NHibernateUtil.String); } cirt = SearchHelper.IntersectCriterions(cirt, Expression.IsNull("Ext1")); SearchCriterion.AutoOrder = false; SearchCriterion.SetOrder(SysUser.Prop_WorkNo); users = SysUserRule.FindAll(SearchCriterion, cirt); } this.PageState.Add("UsrList", users); } else { SearchCriterion.AutoOrder = false; string dName = SearchCriterion.GetSearchValue <string>("Name"); string workNo = SearchCriterion.GetSearchValue <string>("WorkNo"); SearchCriterion.SetOrder(SysUser.Prop_WorkNo); if (dName != null && dName.Trim() != "") { string where = "select * from SysUser where " + GetPinyinWhereString("Name", dName); where += "and Ext1 is null and WorkNo like '%" + workNo + "%'"; this.PageState.Add("UsrList", DataHelper.QueryDictList(where)); } else { ICriterion cirt = null; cirt = SearchHelper.IntersectCriterions(cirt, Expression.IsNull("Ext1")); users = SysUserRule.FindAll(SearchCriterion, cirt); PageState.Add("UsrList", users); } } }
private void DoSelect() { if (according == "Sender") { sql = @"select * from BJKY_SP..IntegratedMessage where ReceiverId='{0}' and State is null and CreateId='{1}' and SubmitState='1' order by CreateTime desc"; sql = string.Format(sql, UserInfo.UserID, createId); } else { sql = @"select * from BJKY_SP..IntegratedMessage where ReceiverId='{0}' and State is null and MessageType='{1}' and SubmitState='1' order by CreateTime desc"; sql = string.Format(sql, UserInfo.UserID, messageType); } PageState.Add("DataList", DataHelper.QueryDictList(sql)); }
private void DoSelect() { IList <ExamineRelation> ents = null; if (!string.IsNullOrEmpty(id)) { ents = ExamineRelation.FindAllByProperty("Id", id); } else { ents = ExamineRelation.FindAll(SearchCriterion); } PageState.Add("DataList", ents); PageState.Add("BeRoleName", SysEnumeration.GetEnumDict("BeExamineObject")); //被考核 PageState.Add("ToRoleName", SysEnumeration.FindAllByProperty(SysEnumeration.Prop_Code, "ExamineObject").First().ChildNodes); //多选下拉框 }
private void DoSelect() { string dName = SearchCriterion.GetSearchValue <string>("Name"); string where = ""; if (dName != null && dName.Trim() != "") { where = "and " + GetPinyinWhereString("B.Name", dName); } string sql = @"select A.UserId as UserId,A.GroupId as GroupId,B.Name,B.WorkNo,C.Name as GroupName from BJKY_Portal..SysUserGroup as A left join BJKY_Portal..SysUser as B on B.UserId=A.UserId left join BJKY_Portal..SysGroup as C on A.GroupId=C.GroupId where PatIndex('%{0}%',C.Path)>0 " + where; PageState.Add("UsrList", GetPageData(string.Format(sql, id), SearchCriterion)); }
private void DoSelect() { if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = PaymentInvoice.Find(id); } } else { ent = new PaymentInvoice(); } SetFormData(ent); PageState.Add("PayType", SysEnumeration.GetEnumDict("PayType")); }
private void DoSelect() { string sql = @"select *,(select top 1 Name from SysEnumeration where Code=ExamYearResult.BeRoleCode ) as BeRoleName from BJKY_Examine..ExamYearResult where ExamineStageId='" + ExamineStageId + "' order by BeRoleCode desc"; IList <EasyDictionary> dics = DataHelper.QueryDictList(sql); PageState.Add("DataList", dics); var obj = new { ExamineStageName = esEnt.StageName, State = esEnt.State, Year = esEnt.Year }; PageState.Add("Obj", obj); }
private void DoSelect() { sql = @"select A.Id, A.PersonSecondIndicatorName,A.Weight, A.ToolTip,A.SelfRemark,A.PersonFirstIndicatorId, B.PersonFirstIndicatorName, B.Weight as FirstWeight,B.IndicatorType from BJKY_Examine..PersonSecondIndicator as A left join BJKY_Examine..PersonFirstIndicator as B on A.PersonFirstIndicatorId=B.Id where B.CustomIndicatorId='{0}' order by B.IndicatorType desc,B.SortIndex asc"; sql = string.Format(sql, id); PageState.Add("DataList", DataHelper.QueryDictList(sql)); SetFormData(ciEnt); PageState.Add("Entity", ciEnt); //加载审批意见表 因为有可能多次审批 IList <CustomIndicatorOpinion> cioEnts = CustomIndicatorOpinion.FindAllByProperty(CustomIndicatorOpinion.Prop_CustomIndicatorId, id); PageState.Add("DataList1", cioEnts); }
private void DoSelect() { string sql = ""; string where = string.Empty; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (item.Value.ToString() != "") { where += " and " + item.PropertyName + " like '%" + item.Value + "%'"; } } sql = @"select * from SHHG_AimExamine..Products where 1=1" + where; PageState.Add("ProductList", GetPageData(sql, SearchCriterion)); PageState.Add("ProductTypeEnum", SysEnumeration.GetEnumDict("ProductType")); }
private void DoSelect() { string where = string.Empty; foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!string.IsNullOrEmpty(item.Value.ToString())) { where += " and " + item.PropertyName + " like '%" + item.Value + "%'"; } } string sql = @"select * from SHHG_AimExamine..Products where 1=1" + where; IList <EasyDictionary> dics = GetPageData(sql, SearchCriterion); PageState.Add("DataList", dics); PageState.Add("ProductTypeEnum", SysEnumeration.GetEnumDict("ProductType")); }
private void DoSelect() { if (msg.State == "2") { msg.ReadCount = msg.ReadCount == null ? 1 : msg.ReadCount.Value + 1; msg.Save(); } if (msg.PostTime != null && msg.PostTime.HasValue) { msg.CreateName = ((DateTime)msg.PostTime).ToString("yyyy-MM-dd HH:mm"); } CollectionToUser[] cts = CollectionToUser.FindAllByProperties("MsgId", msg.Id, "UserId", UserInfo.UserID); PageState.Add("collection", cts.Length > 0 ? "on" : "off"); SetFormData(msg); PageState.Add("ReadStatus", (msg.ReadState + "").IndexOf(UserInfo.UserID)); }
/// <summary> /// 查询 /// </summary> private void DoSelect() { string db = ConfigurationManager.AppSettings["ExamineDB"]; if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime")) { SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false)); } string where = ""; string wherec = " where 1=1 "; if (RequestData.Get <string>("type") == "yi") { where += " [State]='已出库' "; wherec += " and p.[State]='已出库' "; } else { where += " ([State] is null or [State]<>'已出库') "; wherec += " and (p.[State] is null or p.[State]<>'已出库') "; } CommonSearchCriterionItem item = SearchCriterion.Searches.Searches.Where(obj => obj.PropertyName == "Code").FirstOrDefault <CommonSearchCriterionItem>(); SearchCriterion.Searches.RemoveSearch("Code"); if (item != null && item.Value + "" != "") { ents = DeliveryOrder.FindAll(SearchCriterion, Expression.Sql(" Id in (select DId from " + db + "..DelieryOrderPart where PCode like '%" + item.Value + "%') and " + where)); } else { ents = DeliveryOrder.FindAll(SearchCriterion, Expression.Sql(where)); } this.PageState.Add("OrderList", ents); //查询详细产品的数量 foreach (CommonSearchCriterionItem search in SearchCriterion.Searches.Searches) { wherec += " and p." + search.PropertyName + " like '%" + search.Value + "%'"; } if (item != null && item.Value + "" != "") { wherec += " and c.PCode like '%" + item.Value + "%'"; } PageState.Add("quantity", DataHelper.QueryValue("select sum([Count]) from " + db + "..DeliveryOrder p inner join " + db + "..DelieryOrderPart c on c.DId=p.Id" + wherec)); }
string type = String.Empty; // 对象类型 #endregion #region ASP.NET 事件 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); SysParameter ent = null; switch (this.RequestAction) { case RequestActionEnum.Update: ent = this.GetMergedData <SysParameter>(); ent.DoUpdate(); this.SetMessage("修改成功!"); break; case RequestActionEnum.Create: ent = this.GetPostedData <SysParameter>(); ent.CreaterID = UserInfo.UserID; ent.CreaterName = UserInfo.Name; ent.DoCreate(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <SysParameter>(); ent.DoDelete(); this.SetMessage("删除成功!"); return; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = SysParameter.Find(id); } this.SetFormData(ent); } else { PageState.Add("CreaterName", UserInfo.Name); PageState.Add("CreatedDate", DateTime.Now); } }
private void DoSelect() { //string dName = SearchCriterion.GetSearchValue<string>("Name"); string where = ""; //if (dName != null && dName.Trim() != "") //{ // where = "and " + GetPinyinWhereString("B.Name", dName); //} foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) { if (!String.IsNullOrEmpty(item.Value.ToString())) { switch (item.PropertyName) { case "BeginDate": where += " and ReceiveDate>='" + item.Value + "' "; break; case "EndDate": where += " and ReceiveDate<='" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' "; break; default: where += " and B." + item.PropertyName + " like '%" + item.Value + "%' "; break; } } } string sql = @"select A.UserId as UserId,A.GroupId as GroupId,B.Name,B.Email,B.UserType,B.UpFile,B.WorkNo,C.Name as GroupName from SysUserGroup as A left join SysUser as B on B.UserId=A.UserId left join SysGroup as C on A.GroupId=C.GroupId where PatIndex('%{0}%',C.Path+'.'+C.GroupId)>0 and B.Ext1 is null and c.Type=(select type from SysGroup where GroupId='{0}') " + where; sql = string.Format(sql, id); PageState.Add("UsrList", GetPageData(sql, SearchCriterion)); object dt = DataHelper.QueryValue("select a.RootPath+'\\'+b.Path from NCRL_Portal..FileModule as a,FileFolder as b where b.id= a.folderid and a.id=1"); PageState.Add("filemodule", dt.ToString().Replace('\\', '/')); }
protected void Page_Load(object sender, EventArgs e) { //string where = ""; //string i = RequestData.Get<string>("2"); //foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches) //{ // if (item.Value.ToString() != "") // { // where += " and A." + item.PropertyName + " like '%" + item.Value + "%'"; // } //} //找到由登录人创建的 已生成或者已启动的考核阶段 string sql = @"select Id ,StageName,ExamineType,StageType,LaunchDeptName,Year from BJKY_Examine..ExamineStage where (State=1 or State=2) and CreateId='" + UserInfo.UserID + "'"; PageState.Add("DataList", DataHelper.QueryDictList(sql)); }