示例#1
0
 public bool CreateOrder(Orders instance)
 {
     if (instance.ID == 0)
     {
         Db.Orders.InsertOnSubmit(instance);
         Db.Orders.Context.SubmitChanges();
         return true;
     }
     return false;
 }
示例#2
0
 public bool UpdateOrder(Orders instance)
 {
     Orders cache = Db.Orders.FirstOrDefault(p => p.ID == instance.ID);
     if (instance.ID == 0)
     {
         cache.TypeOrderID = instance.TypeOrderID;
         cache.State = cache.State;
         cache.Comment = instance.Comment;
         Db.Role.Context.SubmitChanges();
         return true;
     }
     return false;
 }
		private void detach_Orders(Orders entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Orders(Orders entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
 partial void DeleteOrders(Orders instance);
 partial void UpdateOrders(Orders instance);
 partial void InsertOrders(Orders instance);
		private void detach_Orders(Orders entity)
		{
			this.SendPropertyChanging();
			entity.TypeServices = null;
		}