コード例 #1
0
        public FW_File(File file)
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(EV_Start);

            this.file     = file;
            db            = new AgileManagerDB();
            reports       = db.Reports.Where(r => r.FileID == file.FileID).Include(r => r.employee).ToList();
            interventions = db.Interventions.Where(r => r.FileID == file.FileID).Include(i => i.employee).ToList();
            FrameWorkDB.V1.Application app = db.Applications.First(a => a.ApplicationID == file.license.ApplicationID);

            TX_License1.Text = app.Name;
            TX_License2.Text = $"Versión {app.Version}";
            TX_License4.Text = $"Fin mantenimiento {String.Format("{0:dd/MM/yyyy}", file.license.DateEnd)}";

            if (file.employee != null)
            {
                TB_Employee.Text = $"{file.employee.Code} - {file.employee.Name}";
            }

            TB_State.Text     = $"{file.state.Name}";
            TB_DateStart.Text = $"{String.Format("{0:dd/MM/yyyy}", file.DateStart)}";
            TB_DateEnd.Text   = $"{String.Format("{0:dd/MM/yyyy}", file.DateEnd)}";
            TB_Issue.Text     = $"{file.issue.Name}";
            TB_Priority.Text  = $"{file.priority.Name}";
        }
コード例 #2
0
        public FW_Clients(int mode)
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(EV_Start);

            db          = new AgileManagerDB();
            viewClients = new Model.VW_Clients();

            this.mode = mode;

            DG_Clients.MouseLeftButtonUp += new MouseButtonEventHandler(ClientSelected_Event);
            DG_Clients.MouseDoubleClick  += new MouseButtonEventHandler(EV_ClientOpen);
        }
コード例 #3
0
        private void EV_Start(object sender, RoutedEventArgs e)
        {
            db       = new AgileManagerDB();
            employee = new Employee();

            List <Employee> employees = db.Employees.OrderBy(emp => emp.Code).ToList();

            foreach (Employee emp in employees)
            {
                ComboBoxItem temp = new ComboBoxItem();
                temp.Content = $"{emp.Code} - {emp.Name}";
                temp.Name    = $"employee{emp.EmployeeID}";
                CB_User.Items.Add(temp);
            }
        }
コード例 #4
0
        public void UpdateTable(AgileManagerDB db)
        {
            clients = db.Clients.Include(c => c.dealer).ToList();

            dt.Clear();
            foreach (Client item in clients)
            {
                if (item.dealer != null)
                {
                    dt.Rows.Add(item.ClientID, item.Code, item.Name, item.dealer.Name);
                }
                else
                {
                    dt.Rows.Add(item.ClientID, item.Code, item.Name, "");
                }
            }
        }
コード例 #5
0
        public WorkingBoardController()
        {
            InitializeComponent();
            db          = new AgileManagerDB();
            Information = new Dictionary <string, int>();
            Information.Add("mode", 1);
            Information.Add("oldmode", 1);
            Information.Add("controller", 0);
            Information.Add("oldcontroller", 0);
            Information.Add("option", 2);

            if (db.Files.Where(f => f.state.Name == "En Progreso" && f.EmployeeID == ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID).ToList().Count > 0)
            {
                fileInProgress = db.Files.Last(f => f.state.Name == "En Progreso" && f.EmployeeID == ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID);
            }


            this.Loaded += new RoutedEventHandler(EV_Start);
        }
コード例 #6
0
        public WB_NewFileController(Client client)
        {
            InitializeComponent();
            Information = new Dictionary <string, int>();
            Information.Add("mode", 2);
            Information.Add("oldmode", 2);
            Information.Add("controller", 0);
            Information.Add("oldcontroller", 0);
            Information.Add("option", 3);

            db = new AgileManagerDB();

            file          = new File();
            file.client   = client;
            file.ClientID = client.ClientID;

            reports       = new List <Report>();
            interventions = new List <Intervention>();

            reports.Add(new Report
            {
                Date        = DateTime.Now,
                EmployeeID  = ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID,
                file        = file,
                Description = ""
            });

            interventions.Add(new Intervention
            {
                Date        = DateTime.Now,
                EmployeeID  = ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID,
                file        = file,
                Description = ""
            });

            licenses = db.Licenses.Where(c => c.ClientID == client.ClientID).Include(c => c.application).ToList();

            dealer = client.dealer;

            this.Loaded += new RoutedEventHandler(EV_Start);
        }
コード例 #7
0
        public WB_WorkFileController(File file)
        {
            InitializeComponent();
            Information = new Dictionary <string, int>();
            Information.Add("mode", 3);
            Information.Add("oldmode", 3);
            Information.Add("controller", 0);
            Information.Add("oldcontroller", 0);
            Information.Add("option", 4);

            db = new AgileManagerDB();

            this.file = new File();
            this.file = db.Files.Where(f => f.FileID == file.FileID)
                        .Include(f => f.client).Include(f => f.client.dealer).Include(f => f.priority)
                        .Include(f => f.issue).Include(f => f.employee).First();
            reports = db.Reports.Where(r => r.FileID == file.FileID).ToList();
            reports.Add(new Report
            {
                Date       = DateTime.Now,
                EmployeeID = ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID,
                FileID     = file.FileID
            });

            interventions = db.Interventions.Where(r => r.FileID == file.FileID).ToList();
            interventions.Add(new Intervention
            {
                Date        = DateTime.Now,
                EmployeeID  = ((MainWindow)System.Windows.Application.Current.MainWindow).employee.EmployeeID,
                FileID      = file.FileID,
                Description = ""
            });

            licenses = db.Licenses.Where(c => c.ClientID == this.file.client.ClientID).Include(c => c.application).ToList();

            dealer = this.file.client.dealer;

            this.Loaded += new RoutedEventHandler(EV_Start);
        }
コード例 #8
0
 public VW_Lines()
 {
     db        = new AgileManagerDB();
     employees = db.Employees.Where(e => e.DepartmentID == ((MainWindow)System.Windows.Application.Current.MainWindow).employee.DepartmentID).ToList();
 }
コード例 #9
0
 public IEnumerable GetTable(AgileManagerDB db)
 {
     UpdateTable(db);
     return(dt.DefaultView);
 }
コード例 #10
0
        public VW_Files(int mode)
        {
            this.mode = mode;
            db        = new AgileManagerDB();

            dt = new DataTable();

            switch (mode)
            {
            case 1:
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Código", typeof(string));
                dt.Columns.Add("Cliente", typeof(string));
                dt.Columns.Add("Fecha", typeof(string));
                dt.Columns.Add("Prioridad", typeof(string));
                dt.Columns.Add("Problema", typeof(string));
                break;

            case 3:
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Código", typeof(string));
                dt.Columns.Add("Cliente", typeof(string));
                dt.Columns.Add("Fecha", typeof(string));
                dt.Columns.Add("Prioridad", typeof(string));
                dt.Columns.Add("Problema", typeof(string));
                break;

            case 5:
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Código", typeof(string));
                dt.Columns.Add("Cliente", typeof(string));
                dt.Columns.Add("Fecha Inicio", typeof(string));
                dt.Columns.Add("Fecha Finalización", typeof(string));
                dt.Columns.Add("Prioridad", typeof(string));
                dt.Columns.Add("Problema", typeof(string));
                break;

            case 11:
                Window mainWindow = System.Windows.Application.Current.MainWindow;
                var    a          = (MainWindow)mainWindow;
                WorkingBoard.Controller.FileController CT = (WorkingBoard.Controller.FileController)a.MainFrame.Content;;
                client = CT.file.client;
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Código", typeof(string));
                dt.Columns.Add("Licencia", typeof(string));
                dt.Columns.Add("Técnico", typeof(string));
                dt.Columns.Add("Fecha Inicio", typeof(string));
                dt.Columns.Add("Fecha Finalización", typeof(string));
                dt.Columns.Add("Estado", typeof(string));
                dt.Columns.Add("Prioridad", typeof(string));
                dt.Columns.Add("Problema", typeof(string));
                break;

            default:
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Código", typeof(string));
                dt.Columns.Add("Cliente", typeof(string));
                dt.Columns.Add("Fecha", typeof(string));
                dt.Columns.Add("Prioridad", typeof(string));
                dt.Columns.Add("Problema", typeof(string));
                break;
            }
        }