Server/_Function.asmx.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Web;
using System.Web.Services;
using TeamTask.Model;
namespace TeamTask.Server
{
/// <summary>
/// _Function 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
[System.Web.Script.Services.ScriptService]
public class _Function : System.Web.Services.WebService
{
public _Function()
{
Common.Helper.Validate(Context);
}
[WebMethod(true)]
public dynamic search(int rows, int page, string sidx, string sord, string name, string code, int? parentID)
{
dynamic result = null;
using (var db = new DBContext())
{
var objContext = ((IObjectContextAdapter)db).ObjectContext;
var all = objContext.CreateObjectSet<Function>();
//排序
var whereList = all.OrderBy(string.Format("it.{0} {1}", sidx, sord)).AsQueryable();
//条件
if (name != "")
whereList = whereList.Where(m => m.Name.Contains(name));
if (code != "")
whereList = whereList.Where(m => m.Code.Contains(code));
if (parentID != null && parentID == 0)
whereList = whereList.Where(m => m.ParentID == null);
if (parentID != null && parentID > 0)
whereList = whereList.Where(m => m.ParentID == parentID);
//结果
var records = whereList.Count();
result = new
{
rows =
(from i in whereList.Skip((page - 1) * rows).Take(rows)
select new
{
i.ID,
i.Name,
i.Code,
i.ParentID,
i.Index
}).ToList(),
records = records,
后面还有 102 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。