Ejemplo n.º 1
0
 public Database1Entities1 UpdateProduct(string productName, int price, string status, Products updateproduct, Database1Entities1 db1)
 {
     updateproduct.name             = productName;
     updateproduct.price            = price;
     updateproduct.deleted          = status;
     db1.Entry(updateproduct).State = System.Data.Entity.EntityState.Modified;
     return(db1);
 }
Ejemplo n.º 2
0
 public Database1Entities1 UpdateClient(string companyName, string companyCountry, string priority, string[] ret, string note, string status, Clients updateclient, Database1Entities1 db)
 {
     updateclient.Company.compnay_name    = companyName;
     updateclient.Company.company_country = companyCountry;
     updateclient.Buissnes_Priority       = priority;
     updateclient.Factory_Occupation.factory_occupation_name = ChangeToString(ret);
     updateclient.Note            = note;
     updateclient.Deleted         = status;
     db.Entry(updateclient).State = System.Data.Entity.EntityState.Modified;
     return(db);
 }
Ejemplo n.º 3
0
 public Database1Entities1 UpdateWorker(string type, int salary, string city, string street, string house_number, string gender, string idNumber, string name, string phone, string deleted, employee updateworker1, Database1Entities1 db)
 {
     updateworker1.phone = phone;
     updateworker1.Workers_Gender.Gender = gender;
     updateworker1.name                            = name;
     updateworker1.id_number                       = idNumber;
     updateworker1.deleted                         = deleted;
     updateworker1.employee_type.type              = type;
     updateworker1.employee_type.salary            = salary;
     updateworker1.Postal_Code_Worker.city         = city;
     updateworker1.Postal_Code_Worker.street       = street;
     updateworker1.Postal_Code_Worker.house_number = house_number;
     db.Entry(updateworker1).State                 = System.Data.Entity.EntityState.Modified;
     return(db);
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     //TODO: Validate input
     updateworker1.phone = tPhone.Text;
     updateworker1.Workers_Gender.Gender = tGender.Text;
     updateworker1.name                            = tName.Text;
     updateworker1.id_number                       = tNumberId.Text;
     updateworker1.employee_type.type              = tType.Text;
     updateworker1.employee_type.salary            = tSalary.Text;
     updateworker1.Postal_Code_Worker.city         = tCity.Text;
     updateworker1.Postal_Code_Worker.street       = tStreet.Text;
     updateworker1.Postal_Code_Worker.house_number = tNumberHouse.Text;
     db.Entry(updateworker1).State                 = System.Data.Entity.EntityState.Modified;
     this.db.SaveChanges();
     this.Close();
 }
Ejemplo n.º 5
0
        public Database1Entities1 UpdateOrder(string clientName, DateTime sourceDate, DateTime destinationDate, string ret, int quantity, string note, Orders updateorder, employee emp, string status, Database1Entities1 db1)
        {
            Clients  client  = findClient(db1, clientName);
            Products product = findProduct(db1, ret);

            if (client == null)
            {
                Console.WriteLine("Client does not exist!");
                return(db1);
            }


            if (product == null)
            {
                Console.WriteLine("Product does not exist!");
                return(db1);
            }
            updateorder.Clients.Company.compnay_name = clientName;
            updateorder.Deleted = status;
            updateorder.Order_Details.Delivery_Date     = sourceDate;
            updateorder.Order_Details.Order_Date        = destinationDate;
            updateorder.Order_Details.production_amount = quantity;
            updateorder.Order_Details.Note        = note;
            updateorder.Order_Details.products_id = product.Id_Products;
            //updateorder.Clients.Id_Clients = client.Id_Clients;
            // updateorder.Clients.company_id = client.company_id;

            /* updateorder.Clients.factory_occupation_id = client.factory_occupation_id;
             * updateorder.Clients.Buissnes_Priority = client.Buissnes_Priority;
             * updateorder.Clients.Note = client.Note;
             * updateorder.Clients.Deleted = client.Deleted;*/
            //updateorder.employee.Id_Employee = emp.Id_Employee;
            updateorder.employee.id_number                       = emp.id_number;
            updateorder.employee.name                            = emp.name;
            updateorder.employee.phone                           = emp.phone;
            updateorder.employee.Workers_Gender.Gender           = emp.Workers_Gender.Gender;
            updateorder.employee.employee_type.type              = emp.employee_type.type;
            updateorder.employee.employee_type.salary            = emp.employee_type.salary;
            updateorder.employee.Postal_Code_Worker.street       = emp.Postal_Code_Worker.street;
            updateorder.employee.Postal_Code_Worker.city         = emp.Postal_Code_Worker.city;
            updateorder.employee.Postal_Code_Worker.house_number = emp.Postal_Code_Worker.house_number;
            db1.Entry(updateorder).State                         = System.Data.Entity.EntityState.Modified;
            return(db1);
        }