public ConsumersEnviornment(employee emp)
 {
     InitializeComponent();
     this.emp = emp;
 }
Beispiel #2
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);
 }
 public AddExpeneseWindow(employee emp)
 {
     this.emp = emp;
     InitializeComponent();
 }
Beispiel #4
0
        public Database1Entities1 InsertExpense(string name, string value, DateTime datetime, string note, employee emp, Database1Entities1 db1)
        {
            Expends_Type et = db1.Expends_Type.Add(new Expends_Type {
                name = name
            });

            db1.Expends_Report.Add(new Expends_Report {
                note = note, value = Convert.ToInt32(value), employee = new employee(emp), Expends_Type = et, date = datetime
            });
            return(db1);
        }
 public ManagmentEnviornement(employee emp)
 {
     this.emp = emp;
     InitializeComponent();
 }
Beispiel #6
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);
        }
Beispiel #7
0
        public Database1Entities1 AddOrder(string clientName, DateTime orderDate, DateTime deliveryDate, string ret, int quantity, string note, employee emp, string status, Database1Entities1 db1)
        {
            Database1Entities1 db2    = new Database1Entities1();
            Clients            client = findClient(db1, clientName);

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

            Products product = findProduct(db1, ret);

            if (product == null)
            {
                Console.WriteLine("Product does not exist!");
                return(db2);
            }

            //Products p = db1.Products.Add(new Products { name = ChangeToString(chosen), price = Account(ret, chosen), deleted = "Active"});
            Order_Details od = db1.Order_Details.Add(new Order_Details {
                Order_Date = orderDate, Delivery_Date = deliveryDate, production_amount = quantity, Note = note, products_id = product.Id_Products
            });

            db1.Orders.Add(new Orders {
                Deleted = status, Order_Details = od, employee = new employee(emp), Clients = client
            });
            return(db1);
        }