Dit artikel is een spiegelartikel van machinevertaling, klik hier om naar het oorspronkelijke artikel te gaan.

Bekijken: 22013|Antwoord: 1

[Bron] linq delegeert SQL-instructie-splicing

[Link kopiëren]
Geplaatst op 05-08-2015 10:35:47 | | |
  1. /// <summary>
  2.         /// 请假数据
  3.         /// </summary>
  4.         /// <param name="ApplyUser">用户ID</param>
  5.         /// <param name="title">标题</param>
  6.         /// <param name="startTime">开始时间</param>
  7.         /// <param name="EndTime">结束时间</param>
  8.         /// <param name="Status">状态</param>
  9.         /// <param name="ye">分页</param>
  10.         /// <returns></returns>
  11.         public static List<Model.ViewApprove> GetApprove(string ApplyUser,string title,DateTime? startTime,DateTime? EndTime,byte Status, int ye)
  12.         {
  13.             bool tag=true;
  14.             Func<Model.ViewApprove,bool> fwhere = m =>
  15.             {
  16.                 tag = tag && m.ApplyUser == ApplyUser;
  17.                 if (title != ""&&title!=null)
  18.                   tag=tag&&m.Title.Contains(title);
  19.                 if (startTime!=null)
  20.                     tag = tag && m.ApplyDate >= startTime;
  21.                 if (EndTime != null)
  22.                     tag = tag && m.ApplyDate <= EndTime;
  23.                 if (Status != null)
  24.                     tag = tag && m.Status == Status;
  25.                 return tag;

  26.             };
  27.             return db.ViewApprove.Where(fwhere).Skip(ye).Take(10).ToList();
  28.         }
Code kopiëren






Vorig:Jay Chou's LOL live-uitzending op 4 augustus is te nep!! Slaapt de blinde man aan de andere kant? EZ kan ook naar platinum gaan boven de toren?
Volgend:In augustus 2015 organiseerde het Wuhan International Convention and Exhibition Center elke woensdag en vrijdag een banenbeurs voor talenten uit Centraal-China
 Huisbaas| Geplaatst op 07-08-2015 10:43:16 |
Er staan fouten hierboven op, en de juiste zijn:
  1. /// <summary>
  2.         /// 请假数据
  3.         /// </summary>
  4.         /// <param name="ApplyUser">用户ID</param>
  5.         /// <param name="title">标题</param>
  6.         /// <param name="startTime">开始时间</param>
  7.         /// <param name="EndTime">结束时间</param>
  8.         /// <param name="Status">状态</param>
  9.         /// <param name="ye">分页</param>
  10.         /// <returns></returns>
  11.         public static List<Model.ViewApprove> GetApprove(string ApplyUser,string title,DateTime? startTime,DateTime? EndTime,byte Status, int ye)
  12.         {
  13.          
  14.             Func<Model.ViewApprove,bool> fwhere = m =>
  15.             {
  16.                 bool cktitle = true;
  17.                 bool ckstartTime = true;
  18.                 bool ckEndTime = true;
  19.                 bool ckStatus = true;

  20.                
  21.                 if (title != ""&&title!=null)
  22.                     cktitle = m.Title.Contains(title);
  23.                 if (startTime!=null)
  24.                     ckstartTime = m.ApplyDate >= startTime;
  25.                 if (EndTime != null)
  26.                     ckEndTime = m.ApplyDate <= EndTime;
  27.                 if (Status != 2)
  28.                     ckStatus = m.Status == Status;
  29.                 return m.ApplyUser == ApplyUser && cktitle && ckstartTime && ckStatus;

  30.             };
  31.             return db.ViewApprove.Where(fwhere).Skip(ye).Take(10).ToList();
  32.         }
Code kopiëren


Disclaimer:
Alle software, programmeermaterialen of artikelen die door Code Farmer Network worden gepubliceerd, zijn uitsluitend bedoeld voor leer- en onderzoeksdoeleinden; De bovenstaande inhoud mag niet worden gebruikt voor commerciële of illegale doeleinden, anders dragen gebruikers alle gevolgen. De informatie op deze site komt van het internet, en auteursrechtconflicten hebben niets met deze site te maken. Je moet bovenstaande inhoud volledig van je computer verwijderen binnen 24 uur na het downloaden. Als je het programma leuk vindt, steun dan de echte software, koop registratie en krijg betere echte diensten. Als er sprake is van een inbreuk, neem dan contact met ons op via e-mail.

Mail To:help@itsvse.com