Ejemplo n.º 1
0
 partial void UpdateCustomer(Customer instance);
Ejemplo n.º 2
0
 partial void DeleteCustomer(Customer instance);
Ejemplo n.º 3
0
 partial void InsertCustomer(Customer instance);
Ejemplo n.º 4
0
		private void detach_Customer(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Contact = null;
		}
Ejemplo n.º 5
0
		private void attach_Customer(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Contact = this;
		}
        private void OnUpdate(bool commitUpdate)
        {
            if (currentCustomer == null)
                currentCustomer = DB.GetCustomerByName(Environment.UserName);

            if (!commitUpdate)
            {
                statusMessage += "Update canceled";
            }

            switch (currentView)
            {

                case ItemType.DemandeExpress:
                    displayDemandesExpressByCustomer();
                    break;
                case ItemType.Echange:
                    currentCustomer = DB.GetCustomerByName(Environment.UserName);
                    DisplayEchangesByUser();
                    break;

                default:
                  displayDemandesExpressByCustomer();
                    break;
            }
        }
Ejemplo n.º 7
0
        public static IDBItem AddNewItem(DataClassesDataContext dataContext, ItemType type)
        {
            IDBItem dataItem = null;

            if (type == ItemType.Equipment)
            {
                dataItem = new Equipment();

                dataContext.Resource.InsertOnSubmit(dataItem as Equipment);
            }

            if (type == ItemType.Employee)
            {
                dataItem = new Employee();
                dataContext.Resource.InsertOnSubmit(dataItem as Employee);
            }

            if (type == ItemType.Location)
            {
                dataItem = new Location();
                dataContext.Location.InsertOnSubmit(dataItem as Location);
            }

            if (type == ItemType.Container)
            {
                dataItem = new Container();
                dataContext.Container.InsertOnSubmit(dataItem as Container);
            }

            if (type == ItemType.Product)
            {
                dataItem = new Product();
                dataContext.Product.InsertOnSubmit(dataItem as Product);
            }

            if (type == ItemType.ProductCategory)
            {
                dataItem = new ProductCategory();
                dataContext.ProductCategory.InsertOnSubmit(dataItem as ProductCategory);
            }

            if (type == ItemType.DemandeExpress)
            {
                dataItem = new DemandeExpress();
                dataContext.OrderHeader.InsertOnSubmit(dataItem as DemandeExpress);
            }

            if (type == ItemType.Echange)
            {
                dataItem = new Echange();
                dataContext.OrderHeader.InsertOnSubmit(dataItem as Echange);
            }
            if (type == ItemType.WorkOrder)
            {
                dataItem = new WorkOrder();
                dataContext.WorkOrder.InsertOnSubmit(dataItem as WorkOrder);
            }
            if (type == ItemType.WorkOrderRouting)
            {
                dataItem = new WorkOrderRouting();
                dataContext.WorkOrderRouting.InsertOnSubmit(dataItem as WorkOrderRouting);
            }
            if (type == ItemType.Workstation)
            {
                dataItem = new Workstation();
                //dataContext.WorkOrder.InsertOnSubmit(dataItem as WorkOrder);
                dataContext.Resource.InsertOnSubmit(dataItem as Workstation);
            }
            if (type == ItemType.Customer)
            {
                dataItem = new Customer();
                //dataContext.WorkOrder.InsertOnSubmit(dataItem as WorkOrder);
                dataContext.Customer.InsertOnSubmit(dataItem as Customer);
            }
            if (type == ItemType.Contact)
            {
                dataItem = new Contact();
                dataContext.Contact.InsertOnSubmit(dataItem as Contact);
            }

            return dataItem;
        }