随笔分类 -  Linq

Linq Distinct
摘要:var t = (from orders in replenismentOrders where (string .IsNullOrEmpty (conditDTO .OrderId) || orders .ID ==conditDTO .OrderId) &&(string .IsNullOrEmpty (conditDTO .RVC )|| orders .RVC .ID ==conditDTO .RVC) &&(string .IsNullOrEmpty (conditDTO .OrderStatus.ToString())|| orders .Reple 阅读全文

posted @ 2011-08-27 15:32 EveryMan

Model
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.Linq.Mapping;using System.Data;namespace GoldAnt.Model{ [Serializable] [Table(Name = "CargoList")] public class CargoListModel { /// <summary> ///默认不带参数的构造函数 /// Defualt function /// & 阅读全文

posted @ 2011-06-01 13:24 EveryMan

Lint拼Sql 增删改查
摘要:===============Lint拼Sql=======using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using LogisticsHR.Linq;using LogisticsHR.Model;using System.Data.Linq.SqlClient;using LogisticsHR.Utility;using System.Web.UI.WebControls;using System.Data.SqlClient;usin 阅读全文

posted @ 2011-06-01 13:21 EveryMan

Select
摘要:===============Join=============public List<CustomersInfoModel> GetCmpInfo() { try { ComDataContext _context = new ComDataContext(ComDataContext.ConneStr); var t = (from a in _context.UserRoleRelationModel join b in _context.UserInfoModel on a.Usr_Id equals b.Usr_Id join c in _context.Customer 阅读全文

posted @ 2011-05-28 16:48 EveryMan

Update
摘要:public bool Update(string task_No,string use_Flag) { ComDataContext context = new ComDataContext(ComDataContext.ConneStr); try { // 如果是修改单个字段建议先查出来再修改制定字段,比查出来再删除->再保存要少操作一次数据库,无需删除这一步 TaskInfoModel modelNew = context.TaskInfoModel.Single(b => b.task_No == task_No); modelNew.Use_Flag =use_Flag 阅读全文

posted @ 2011-05-28 16:48 EveryMan

Delete
摘要:public void Delete(ComDataContext context, string task_No) { var t = (from A in context.TaskPaperSetModel where A.Task_No==task_No select A); context.TaskModel.DeleteAllOnSubmit (t ); context.SubmitChanges();} 阅读全文

posted @ 2011-05-28 16:48 EveryMan

Insert
摘要:1 阅读全文

posted @ 2011-05-28 16:47 EveryMan

导航