コード例 #1
0
        public void AddWorklog(Worklog worklog)
        {
            String sql = "INSERT into Arbeitet(F_PROJEKT_ID, F_MITARBEITER_ID, VON, BIS) VALUES (" +
                worklog.ProjectId + ", " +
                worklog.EmployeeId + ", '" +
                worklog.Start + "', '" +
                worklog.End + "')";
            FbCommand com = new FbCommand(sql, conn);

            FbDataReader dr = com.ExecuteReader();
            dr.Read();
            dr.Close();
        }
コード例 #2
0
        public void AddWorklog(Worklog worklog)
        {
            if (_worklogs.Count > 0)
            {
                int highestId = _worklogs[_worklogs.Count - 1].Id;
                worklog.Id = highestId + 1;
            }
            else
            {
                worklog.Id = 1;
            }

            _worklogs.Add(worklog);
        }
コード例 #3
0
        public void AddWorklog(Worklog worklog)
        {
            //XML
            DataTable dt = new DataTable();
            dt.TableName = "Project";

            DataColumn von = new DataColumn("VON");
            DataColumn bis = new DataColumn("BIS");

            dt.Columns.Add(von);
            dt.Columns.Add(bis);
            /*TextBox müssen noch angepasst werden */
            dt.Rows.Add(TextBox.Text, TextBox.Text);

            DataSet ds = new DataSet();
            ds.Tables.Add(dt);
            ds.WriteXml("ASProjekt.xml");
        }
コード例 #4
0
        void addArbeitszeiten()
        {
            //Menue für das Hinzufügen
            Console.Write("Bitte geben sie die Id des Mitarbeiters an:");
            var EmployeeId = Console.ReadLine();
            Console.WriteLine("Bitte geben sie den Start an:");
            var start = Console.ReadLine();
            Console.WriteLine("Bitte geben sie das Ende an:");
            var ende = Console.ReadLine();
            Console.WriteLine("Bitte geben sie die Projekt ID an:");
            var ProjectId = Console.ReadLine();

            var Wworklog = new Worklog();
            //Überprüfung der Eingaben
            int Id1; //ID für Mitarbeiter
            int Id2; //ID für Projekte
            bool employeeIdCorrect;
            bool projectIdCorrect;
            if (employeeIdCorrect = int.TryParse(EmployeeId, out Id1))
            { Wworklog.EmployeeId = Id1; }
            if (projectIdCorrect = int.TryParse(ProjectId, out Id2))
            { Wworklog.ProjectId = Id2; }

            Wworklog.Start = start;
            Wworklog.End = ende;

            if (employeeIdCorrect == true && projectIdCorrect == true)
            {
                //Weiterleitung an das Fachkonzept
                fachkonzept.AddWorklog(Wworklog);
            }
            else
            {
                //Fehleingabe
                Console.WriteLine("Eingabe nicht korrekt. Bitte erneut einegeben!");
                Console.ReadKey();
            }
        }
コード例 #5
0
        public MockStorage()
        {
            Employee marioSuper = new Employee("Super", "Mario");
            marioSuper.Profession = "Klempner";
            AddEmployee(marioSuper);

            Employee gordenFreeman = new Employee("Freeman", "Gorden");
            gordenFreeman.Profession = "Physiker";
            AddEmployee(gordenFreeman);

            Project BER = new Project();
            BER.Location = "Berlin";
            BER.Title = "Flughafen Berlin Brandenbug";
            BER.Start = "1157457600";
            BER.End = "1504612800";
            AddProject(BER);

            Worklog foo = new Worklog();
            foo.EmployeeId = 1;
            foo.ProjectId = 1;
            foo.Start = "1448276947";
            foo.End = "1448301924";
            AddWorklog(foo);
        }
コード例 #6
0
 public void AddWorklog(Worklog worklog)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public void UpdateWorklog(Worklog worklog)
 {
     _storage.UpdateWorklog(worklog);
 }
コード例 #8
0
 public void AddWorklog(Worklog worklog)
 {
     _storage.AddWorklog(worklog);
 }
コード例 #9
0
        public void UpdateWorklog(Worklog worklog)
        {
            //XML
                DataTable dt = new DataTable();
                dt.TableName = "Project";

                DataColumn von = new DataColumn("VON");
                DataColumn bis = new DataColumn("BIS");

                /*TextBox müssen noch angepasst werden */
                /*Rows Dynamisch* anpassen*/
                dt.Rows.Add(TextBox.Text, TextBox.Text);
                dt.Rows[][von] = TextBox.Text;
                dt.Rows[][bis] = TextBox.Text;
                DataSet ds = new DataSet();
                ds.Tables.Add(dt);
                ds.WriteXml("ASProjekt.xml");
        }
コード例 #10
0
 public void UpdateWorklog(Worklog updatedWorklog)
 {
     Worklog worklog = _worklogs.FirstOrDefault(o => o.Id == updatedWorklog.Id);
     if (worklog != null)
     {
         worklog = updatedWorklog;
     }
     else
     {
         throw new ArgumentException("Worklog not found in storage.");
     }
 }
コード例 #11
0
 public void UpdateWorklog(Worklog worklog)
 {
     BusinessLogic.UpdateWorklog(worklog);
 }
コード例 #12
0
 public void AddWorklog(Worklog worklog)
 {
     BusinessLogic.AddWorklog(worklog);
 }
コード例 #13
0
        public void UpdateWorklog(Worklog worklog)
        {
            //Firebird
            /*
            FbConnection conn = new FbConnection(connString);
            conn.Open();
            string sql = "UPDATE Arbeitet SET('VON' = '@VON' , 'BIS' = '@BIS')";

            FbCommand com = new FbCommand(sql, conn);

            com.Parameters.Add("@VON", TextBox.Text);
            com.Parameters.Add("@BIS", TextBox.Text);
            FbDataReader dr = com.ExecuteReader();
            while (dr.Read())
            {
                Console.WriteLine(dr.GetString(0));
            }
            dr.Close();
            conn.Close();
            Console.ReadLine();
             */
        }
コード例 #14
0
        public List<Worklog> GetWorklogs()
        {
            String sql = "SELECT * FROM ARBEITET";
            FbCommand com = new FbCommand(sql, conn);
            FbDataReader dr = com.ExecuteReader();
            List<Worklog> resultsList = new List<Worklog>();
            while (dr.Read())
            {
                int id = dr.GetInt32(0);
                int projectId = dr.GetInt32(1);
                int employeeId = dr.GetInt32(2);
                string start = dr.GetString(3);
                string end = dr.GetString(4);
                Worklog worklog = new Worklog()
                {
                    Id = id,
                    ProjectId = projectId,
                    EmployeeId = employeeId,
                    Start = start,
                    End = end
                };
                resultsList.Add(worklog);
            }
            dr.Close();

            return resultsList;
        }