本文整理汇总了C#中IShow.ChooseDishes.Data.ChooseDishesEntities类的典型用法代码示例。如果您正苦于以下问题:C# ChooseDishesEntities类的具体用法?C# ChooseDishesEntities怎么用?C# ChooseDishesEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChooseDishesEntities类属于IShow.ChooseDishes.Data命名空间,在下文中一共展示了ChooseDishesEntities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateRawUnitDeletedStatusById
public bool UpdateRawUnitDeletedStatusById(int Id, int DeletedStatus)
{
if (Id < 0)
{
return false;
}
//修改 直接修改
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
try
{
var type = entities.RawUnit.SingleOrDefault(bt => bt.UnitId == Id);
if (type != null)
{
type.Deleted = DeletedStatus;
entities.SaveChanges();
return true;
}
}
catch (Exception e)
{
e.ToString();
return false;
}
return false;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:27,代码来源:RawUnitDataService.cs
示例2: QueryAll
/// <summary>
///
/// </summary>
/// <returns></returns>
public List<DishesMenu> QueryAll() {
using (ChooseDishesEntities entities = new ChooseDishesEntities()) {
return entities.DishesMenu.Where(bt=>bt.Deleted == 0 ).ToList();
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:11,代码来源:DishesMenuService.cs
示例3: GetAll
public List<TableItem> GetAll()
{
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
return entities.TableItem.Include(typeof(Table).Name).Where(t => t.Deleted == 0).ToList();
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:7,代码来源:TableItemService.cs
示例4: addLocation
//0添加失败,-1添加重复
public int addLocation(Location location)
{
int flag = 0;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
//查询编码是否存在
var type = entities.Location.SingleOrDefault(bt => bt.Code == location.Code && bt.Deleted == 0);
if (type == null)
{
//实体绑定数据
entities.Location.Add(location);
try
{
//操作数据库
flag = entities.SaveChanges();
}
catch (Exception ex)
{
ex.ToString();
}
}
else
{
flag = -1;
}
}
return flag;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:30,代码来源:ChooseDishesDataService.cs
示例5: QueryByDomain
/// <summary>
/// 按参数所在模块查询
/// </summary>
/// <param name="domain"></param>
public List<Config> QueryByDomain(string domain)
{
using (ChooseDishesEntities entities = new ChooseDishesEntities()) {
return entities.Config.Where(c => c.Domain.Equals(domain)).ToList();
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:11,代码来源:ConfigurationService.cs
示例6: UpdateRawUnit
public bool UpdateRawUnit(RawUnit rw)
{
if (rw == null)
{
return false;
}
//修改 直接修改
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
try
{
var type = entities.RawUnit.SingleOrDefault(bt => bt.UnitId == rw.UnitId);
if (type != null)
{
type.Deleted = rw.Deleted;
type.Name = rw.Name;
type.Status = rw.Status;
type.UpdateBy = rw.UpdateBy;
type.UpdateDatetime = rw.UpdateDatetime;
entities.SaveChanges();
return true;
}
}
catch (Exception e)
{
e.ToString();
return false;
}
return false;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:32,代码来源:RawUnitDataService.cs
示例7: UpdateTakeoutClientInfo
//根据外卖客户id修改外卖客户信息
public bool UpdateTakeoutClientInfo(TakeoutClientInfo info)
{
if (info == null)
{
return false;
}
//修改 直接修改
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
try
{
var type = entities.TakeoutClientInfo.SingleOrDefault(bt => bt.OrderPeopleId == info.OrderPeopleId);
if (type != null)
{
type.Order_people = info.Order_people;
type.Mobile = info.Mobile;
type.Status = info.Status;
type.Telephone = info.Telephone;
type.Update_by = info.Update_by;
type.Update_datetime = info.Update_datetime;
type.Address = info.Address;
type.Deleted = info.Deleted;
entities.SaveChanges();
return true;
}
}
catch (Exception e)
{
e.ToString();
return false;
}
return false;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:36,代码来源:TakeoutOrderDataService.cs
示例8: UpdateTakeoutClientDeletedById
//根据外卖客户id修改外卖客户Deleted状态
public bool UpdateTakeoutClientDeletedById(int id,int DeletedStatas)
{
if (id <0)
{
return false;
}
//修改 直接修改
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
try
{
var type = entities.TakeoutClientInfo.SingleOrDefault(bt => bt.OrderPeopleId == id);
if (type != null)
{
type.Deleted = DeletedStatas;
entities.SaveChanges();
return true;
}
}
catch (Exception e)
{
e.ToString();
return false;
}
return false;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:28,代码来源:TakeoutOrderDataService.cs
示例9: LoadParentId
//根据ID查询大类
public DishType LoadParentId(int? id)
{
try
{
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
DishType type = new DishType(); ;
if (id != null)
{
type = (DishType)entities.DishType.Where(info => info.DishTypeId == id && info.Deleted == 0 && info.Status == 0).Single();
if (type == null)
{
type = new DishType();
}
}
return type;
};
}
catch (Exception e)
{
throw e;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:26,代码来源:DiscountDataService+.cs
示例10: QueryAll
/// <summary>
///
/// </summary>
/// <returns></returns>
public List<DishesMenu> QueryAll() {
using (ChooseDishesEntities entities = new ChooseDishesEntities()) {
return entities.DishesMenu.ToList();
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:11,代码来源:DishesMenuService.cs
示例11: SaveTableType
//新增桌类
public int SaveTableType(TableType type)
{
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
try
{
Hashtable hash = new Hashtable();//返回结果
List<TableType> types;
//检查类型编号或者类型名称是否重复
types = entities.TableType.Where(info => info.Name == type.Name || info.Code == type.Code).ToList();
if (types != null && types.Count > 0)
{
hash.Add("code", 1);
if (types[0].Name == type.Name)
{
throw new ServiceException("类型名称已经存在,请重新命名!");
}
else if (types[0].Code == type.Code)
{
throw new ServiceException("类型编号已经存在!");
}
}
entities.TableType.Add(type);
entities.SaveChanges();
return type.TableTypeId;
}
catch (Exception e)
{
throw new ServiceException(e.Message);
}
};
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:34,代码来源:TableService.cs
示例12: Add
/// <summary>
/// 添加用户
/// </summary>
/// <param name="employeeId"></param>
public int Add(int employeeId,string username,string passwd) {
using (ChooseDishesEntities entities = new ChooseDishesEntities()) {
Employee employee = entities.Employee.Find(employeeId);
if (null == employee) {
throw new ServiceException("无法找到对应的员工,编号为:【"+employeeId+"】");
}
int authorId=SubjectUtils.GetAuthenticationId();
UserInfo _UserInfo = new UserInfo();
_UserInfo.EmployeeId = employeeId;
if (null != username || null!=passwd) {
_UserInfo.Username = username;
_UserInfo.Salt = CryptoUtils.GetSalt();
_UserInfo.Password = CryptoUtils.MD5Encrypt(passwd);
_UserInfo.CreateBy = SubjectUtils.GetAuthenticationId();
}
_UserInfo.CreateDatetime = DateTime.Now;
entities.UserInfo.Add(_UserInfo);
try
{
entities.SaveChanges();
Log.A(Loggers.USER_NEW, authorId, _UserInfo.UserId);
}catch(DbEntityValidationException e){
throw new ServiceException(e.Message);
}
return _UserInfo.UserId;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:33,代码来源:UserService.cs
示例13: QueryUsers
/// <summary>
/// 查询所有用户
/// </summary>
/// <returns></returns>
public List<UserInfo> QueryUsers() {
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
//查询所有非删除的
return entities.UserInfo.Where(t => t.Deleted == 0).ToList();
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:12,代码来源:UserService.cs
示例14: queryByLocation
public List<Location> queryByLocation()
{
List<Location> local;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
local = entities.Location.Where(Location => Location.Deleted == 0).ToList();
}
return local;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:9,代码来源:ChooseDishesDataService.cs
示例15: queryById
//查询所有折扣方案
public DiscountProgram queryById(int id)
{
DiscountProgram program;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
program = entities.DiscountProgram.Where(Program => Program.Deleted == 0 && Program.Status == 0&& Program.DiscountId == id).Single();
}
return program;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:10,代码来源:DiscountDataService+.cs
示例16: queryByDetailId
//查询折扣方案明细
public List<DiscountDetail> queryByDetailId(int id)
{
List<DiscountDetail> program;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
program = entities.DiscountDetail.Where(Detail => Detail.Deleted == 0 && Detail.Status == 0 && Detail.DiscountId == id).ToList();
}
return program;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:10,代码来源:DiscountDataService+.cs
示例17: queryAll
//查询所有折扣方案
public List<DiscountProgram> queryAll()
{
List<DiscountProgram> program;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
program = entities.DiscountProgram.Where(Program => Program.Deleted == 0 && Program.Status==0).ToList();
}
return program;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:10,代码来源:DiscountDataService+.cs
示例18: GetDetailByTableId
//TODO 建立与开台关联的关系和获取订单对象
public List<TableItem> GetDetailByTableId(int TableId)
{
List<TableItem> tis;
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
tis=entities.TableItem.Include(typeof(Table).Name).Include(typeof(DeskDishes).Name).Where(t => t.Deleted == 0&&t.TableId==TableId).ToList();
}
return tis;
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:11,代码来源:TableItemService.cs
示例19: Add
public int Add(string code, string name)
{
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
DishesMenu menu = DishesMenuModel.build(code, name, 1000);
entities.DishesMenu.Add(menu);
entities.SaveChanges();
return menu.MenusId;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:11,代码来源:DishesMenuService.cs
示例20: Find
/// <summary>
/// 通过名称获取该值,该接口未查找到相应的值时,抛出异常
/// </summary>
/// <param name="name"></param>
/// <param name="domain"></param>
/// <returns></returns>
public Config Find(string name)
{
using (ChooseDishesEntities entities = new ChooseDishesEntities())
{
Config config = entities.Config.Single(c => c.Name.Equals(name));
if (null == config)
{
throw new NotFoundException("参数名【" + name + "】未找到匹配的项!");
}
return config;
}
}
开发者ID:huangxuanheng,项目名称:ChooseDishes,代码行数:18,代码来源:ConfigurationService.cs
注:本文中的IShow.ChooseDishes.Data.ChooseDishesEntities类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论