本文整理汇总了C#中LDLWCFService.EF.LDLLogisticsEntities类的典型用法代码示例。如果您正苦于以下问题:C# LDLLogisticsEntities类的具体用法?C# LDLLogisticsEntities怎么用?C# LDLLogisticsEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LDLLogisticsEntities类属于LDLWCFService.EF命名空间,在下文中一共展示了LDLLogisticsEntities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Delete
/// <summary>
/// 删除员工
/// </summary>
public static void Delete(CoEmployee employee, bool delUser)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该员工是否存在
CoEmployee _employee = context.CoEmployee.FirstOrDefault(obj => obj.ID == employee.ID);
if (_employee == null)
throw new FaultException(string.Format("该员工[{0}]不存在!", employee.Name));
EntityObjectHelper.Copyto(employee, ref _employee); //利用反射动态赋值
if (delUser)
{
SysUser user = context.SysUser.FirstOrDefault(obj => obj.EmployeeID == employee.ID);
if (user != null)
context.SysUser.DeleteObject(user);
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoEmployeeAdapter04", Define.Delete, user)); //记录日志
}
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoEmployeeAdapter05", Define.Delete, employee)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:haiming929,项目名称:LDL,代码行数:28,代码来源:CoEmployeeAdapter.cs
示例2: DeleteStockWaybillProvide
/// <summary>
/// 运单发放删除
/// </summary>
public static void DeleteStockWaybillProvide(int id)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
StockWaybillProvide objProvide = context.StockWaybillProvide.FirstOrDefault(obj => obj.ID == id && obj.Valid == true);
if (objProvide == null)
throw new Exception("运单发放记录不存在");
//StockWaybill State 0:已报损报废 1:已使用 2:未使用 3:审核中
long startCode = long.Parse(objProvide.StartCode);
long endCode = long.Parse(objProvide.EndCode);
for (long i = startCode; i <= endCode; i++)
{
string currentCode = i.ToString();
StockWaybill objWaybill = context.StockWaybill.FirstOrDefault(obj => obj.OwnerSite == objProvide.DestSite && obj.Code == currentCode);
if (objWaybill == null)
throw new Exception(string.Format("运单号[{0}]不存在", currentCode));
objWaybill.OwnerSite = objProvide.SrcSite;
objWaybill.Type = "库存";
objWaybill.State = "2";
}
//设置物料发放记录无效
objProvide.Valid = false;
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("StockWaybillAdapter04", Define.Delete, objProvide)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:35,代码来源:StockWaybillAdapter.cs
示例3: DeleteStockWaybillRegister
/// <summary>
/// 删除入库登记
/// </summary>
public static void DeleteStockWaybillRegister(int id)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
StockWaybillRegister objRegister = context.StockWaybillRegister.FirstOrDefault(obj => obj.ID == id && obj.Valid == true);
if (objRegister == null)
throw new Exception("该入库登记记录不存在");
//StockWaybill State 0:已报损报废 1:已使用 2:未使用 3:审核中
long startCode = long.Parse(objRegister.StartCode);
long endCode = long.Parse(objRegister.EndCode);
for (long i = startCode; i <= endCode; i++)
{
string currentCode = i.ToString();
StockWaybill objWaybill = context.StockWaybill.FirstOrDefault(obj => obj.Code == currentCode);
if (objWaybill == null)
throw new Exception(string.Format("运单号[{0}]不存在", currentCode));
else if (objWaybill.Type == "发放")
throw new Exception(string.Format("运单号[{0}]已发放", currentCode));
else if (objWaybill.OwnerSite != objWaybill.OwnerSite)
throw new Exception(string.Format("运单号[{0}]不属于该站点", currentCode));
context.StockWaybill.DeleteObject(objWaybill);
}
//设置入库登记记录无效
objRegister.Valid = false;
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("StockWaybillAdapter02", Define.Delete, objRegister)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:38,代码来源:StockWaybillAdapter.cs
示例4: DeleteStockGoodsRegister
/// <summary>
/// 删除入库登记
/// </summary>
public static void DeleteStockGoodsRegister(int id)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
StockGoodsRegister objRegister = context.StockGoodsRegister.FirstOrDefault(obj => obj.ID == id && obj.Valid == true);
if (objRegister == null)
throw new Exception("该入库登记记录不存在");
StockGoods objGoods = context.StockGoods.FirstOrDefault(obj => obj.OwnerSite == objRegister.OwnerSite && obj.Goods == objRegister.Goods);
if (objGoods == null)
throw new Exception("库存记录不存在");
if (objRegister.ActionType == "入库")
{
if (objGoods.Number < objRegister.Number)
throw new Exception(string.Format("库存数量({0})低于入库登记的数量({1})", objGoods.Number, objRegister.Number));
objGoods.Number -= objRegister.Number;
}
else
{
objGoods.Number += objRegister.Number;
}
//设置入库登记记录无效
objRegister.Valid = false;
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("StockGoodsAdapter02", Define.Delete, objRegister)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:36,代码来源:StockGoodsAdapter.cs
示例5: GetFunctionByRole
/// <summary>
/// 获取菜单列表
/// </summary>
//public static List<SysFunction> GetFunctionByUserName(string userName)
//{
// LDLLogisticsEntities context = new LDLLogisticsEntities();
// List<string> lstUserFunction = context.SysUserFunction.Where(obj => obj.UserName == userName).ToList().
// ConvertAll<string>(obj => obj.FunctionCode);
// return context.SysFunction.Where(obj => obj.Valid && lstUserFunction.Contains(obj.Code)).ToList();
//}
/// <summary>
/// 获取菜单列表
/// </summary>
public static List<SysFunction> GetFunctionByRole(string roleCode)
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
List<string> lstUserFunction = context.SysRoleFunction.Where(obj => obj.RoleCode.Trim().ToLower() == roleCode.Trim().ToLower()).ToList().
ConvertAll<string>(obj => obj.FunctionCode);
return context.SysFunction.Where(obj => obj.Valid && lstUserFunction.Contains(obj.Code)).OrderBy(obj => obj.OrderID).ToList();
}
开发者ID:haiming929,项目名称:LDL,代码行数:20,代码来源:SysFunctionAdapter.cs
示例6: DeleteQuoteMain
/// <summary>
/// 删除报价
/// </summary>
public static void DeleteQuoteMain(string guid)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该站点是否存在
QuoteMain quoteMain = context.QuoteMain.FirstOrDefault(obj => obj.Guid == guid);
if (quoteMain == null)
throw new FaultException(string.Format("报价不存在!"));
quoteMain.Valid = false;
//context.QuoteMain.DeleteObject(quoteMain); //删除
//删除报价关系表
//IQueryable<QuoteMainRelation> queryQuoteMainRelation = context.QuoteMainRelation.Where(obj => obj.SrcID == quoteMain.Guid);
//foreach (QuoteMainRelation obj in queryQuoteMainRelation)
// context.QuoteMainRelation.DeleteObject(obj);
//删除报价公式表
//IQueryable<QuoteExpression> queryQuoteExpression = context.QuoteExpression.Where(obj => obj.SrcID == quoteMain.Guid);
//foreach (QuoteExpression obj in queryQuoteExpression)
// context.QuoteExpression.DeleteObject(obj);
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("QuoteMainAdapter02", Define.Delete, quoteMain)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:30,代码来源:QuoteMainAdapter.cs
示例7: GetStockGoodsBySite
/// <summary>
/// 获取库存记录
/// </summary>
public static List<StockGoods> GetStockGoodsBySite(string siteCode)
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
if (string.IsNullOrEmpty(siteCode))
return context.StockGoods.ToList();
else
return context.StockGoods.Where(obj => obj.OwnerSite == siteCode).ToList();
}
开发者ID:hjqcan,项目名称:LDL,代码行数:11,代码来源:StockGoodsAdapter.cs
示例8: GetVersion
public static int GetVersion(string type)
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
SysVersion version = context.SysVersion.FirstOrDefault(obj => obj.Type.ToLower().Trim() == type.ToLower().Trim());
if (version == null)
return -1;
else
return version.Version;
}
开发者ID:haiming929,项目名称:LDL,代码行数:9,代码来源:SysVersionAdapter.cs
示例9: GetUser
/// <summary>
/// 获取用户
/// </summary>
public static SysUser GetUser(string userName)
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该用户是否存在
SysUser user = context.SysUser.FirstOrDefault(obj => obj.UserName.Trim().ToLower() == userName.Trim().ToLower() && obj.Valid == true);
if (user == null)
throw new FaultException(string.Format("用户[{0}]不存在!", user.UserName));
return user;
}
开发者ID:haiming929,项目名称:LDL,代码行数:13,代码来源:SysUserAdapter.cs
示例10: GetFirstWaybillCodeBySite
/// <summary>
/// 获取号码最低的可用运单编号
/// </summary>
public static string GetFirstWaybillCodeBySite(string siteID)
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//获取最后一个运单
StockWaybill lastStockWaybill = context.StockWaybill.OrderByDescending(obj => obj.Code).FirstOrDefault(obj => obj.OwnerSite == siteID && obj.State == "1" && obj.Type == "发放");
string lastCode = lastStockWaybill == null ? "0" : lastStockWaybill.Code;
//获取最新的一个可用的运单编号
StockWaybill newStockWaybill = context.StockWaybill.OrderBy(obj => obj.Code).FirstOrDefault(obj => obj.OwnerSite == siteID && obj.Code.CompareTo(lastCode) > 0 && obj.State == "2" && obj.Type == "发放");
if (newStockWaybill == null)
return null;
else
return newStockWaybill.Code;
}
开发者ID:hjqcan,项目名称:LDL,代码行数:16,代码来源:WaybillInfoAdapter.cs
示例11: Insert
/// <summary>
/// 新增员工
/// </summary>
public static void Insert(CoEmployee employee)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该员工是否存在
if (context.CoEmployee.FirstOrDefault(obj => obj.Code.Trim().ToLower() == employee.Code.Trim().ToLower() && obj.Valid == true) != null)
throw new FaultException(string.Format("员工编号[{0}]已存在!", employee.Code));
context.CoEmployee.AddObject(employee); //新增
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoEmployeeAdapter01", Define.Insert, employee)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:haiming929,项目名称:LDL,代码行数:20,代码来源:CoEmployeeAdapter.cs
示例12: Insert
/// <summary>
/// 新增角色
/// </summary>
public static void Insert(SysRole role)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该角色是否存在
if (context.SysRole.FirstOrDefault(obj => obj.RoleCode.ToLower().Trim() == role.RoleCode.ToLower().Trim()) != null)
throw new FaultException(string.Format("角色编码[{0}]已存在!", role.RoleCode));
context.SysRole.AddObject(role); //新增
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("SysRoleAdapter01", Define.Insert, role)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:haiming929,项目名称:LDL,代码行数:20,代码来源:SysRoleAdapter.cs
示例13: Insert
/// <summary>
/// 新增客户
/// </summary>
public static void Insert(CoCustomers customers)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该客户是否存在
if (context.CoCustomers.Any(obj => obj.Code.Trim().ToLower() == customers.Code.Trim().ToLower() && obj.Valid == true))
throw new FaultException(string.Format("客户编码[{0}]已存在!", customers.Code));
context.CoCustomers.AddObject(customers); //新增
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoCustomersAdapter01", Define.Insert, customers)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:20,代码来源:CoCustomersAdapter.cs
示例14: Insert
/// <summary>
/// 新增司机
/// </summary>
public static void Insert(CoDriver driver)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该司机是否存在
if (context.CoDriver.Any(obj => obj.Code == driver.Code && obj.Valid == true) )
throw new FaultException(string.Format("司机编码[{0}]已存在!", driver.Code));
context.CoDriver.AddObject(driver); //新增
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoDriverAdapter01", Define.Insert, driver)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:20,代码来源:CoDriverAdapter.cs
示例15: Insert
/// <summary>
/// 新增菜单
/// </summary>
public static void Insert(SysFunction function)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该菜单是否存在
if (context.SysFunction.FirstOrDefault(obj => obj.Code == function.Code) != null)
throw new FaultException(string.Format("菜单编码[{0}]已存在!", function.Code));
context.SysFunction.AddObject(function); //新增
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("SysFunctionAdapter01", Define.Insert, function)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:haiming929,项目名称:LDL,代码行数:20,代码来源:SysFunctionAdapter.cs
示例16: Delete
/// <summary>
/// 删除客户
/// </summary>
public static void Delete(int id)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该客户是否存在
CoCustomers customers = context.CoCustomers.FirstOrDefault(obj => obj.ID == id);
if (customers == null)
throw new FaultException(string.Format("客户不存在!"));
context.CoCustomers.DeleteObject(customers); //删除
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoCustomersAdapter02", Define.Delete, customers)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:21,代码来源:CoCustomersAdapter.cs
示例17: Delete
/// <summary>
/// 删除菜单
/// </summary>
/// <param name="userName"></param>
public static void Delete(string code)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该用户是否存在
SysFunction function = context.SysFunction.FirstOrDefault(obj => obj.Code == code);
if (function == null)
throw new FaultException(string.Format("菜单[{0}]不存在!", code));
context.SysFunction.DeleteObject(function); //删除
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("SysFunctionAdapter02", Define.Delete, function)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:haiming929,项目名称:LDL,代码行数:22,代码来源:SysFunctionAdapter.cs
示例18: Delete
/// <summary>
/// 删除司机
/// </summary>
public static void Delete(int id)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该司机是否存在
CoDriver driver = context.CoDriver.FirstOrDefault(obj => obj.ID == id);
if (driver == null)
throw new FaultException(string.Format("司机不存在!"));
context.CoDriver.DeleteObject(driver); //删除
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoDriverAdapter02", Define.Delete, driver)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:21,代码来源:CoDriverAdapter.cs
示例19: Update
/// <summary>
/// 修改部门
/// </summary>
public static void Update(CoDepartment dept)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该部门是否存在
CoDepartment _dept = context.CoDepartment.FirstOrDefault(obj => obj.ID == dept.ID);
if (_dept == null)
throw new FaultException(string.Format("该部门不存在!"));
EntityObjectHelper.Copyto(dept, ref _dept); //利用反射动态赋值
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoDepartmentAdapter03", Define.Update, _dept)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:22,代码来源:CoDepartmentAdapter.cs
示例20: Update
/// <summary>
/// 修改客户
/// </summary>
public static void Update(CoCustomers customers)
{
try
{
LDLLogisticsEntities context = new LDLLogisticsEntities();
//查找该客户是否存在
CoCustomers _customers = context.CoCustomers.FirstOrDefault(obj => obj.ID == customers.ID);
if (_customers == null)
throw new FaultException(string.Format("该客户[{0}]不存在!", customers.Name));
EntityObjectHelper.Copyto(customers, ref _customers); //利用反射动态赋值
context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("CoCustomersAdapter03", Define.Update, _customers)); //记录日志
context.SaveChanges(); //提交保存
}
catch (Exception ex)
{
throw new FaultException(ex.Message);
}
}
开发者ID:hjqcan,项目名称:LDL,代码行数:22,代码来源:CoCustomersAdapter.cs
注:本文中的LDLWCFService.EF.LDLLogisticsEntities类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论