Пример #1
0
        public List <Milestones> GetOnlyMilestones(int pid)
        {
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            Milestones            mile    = new Milestones();
            var mileList = new List <Milestones>();

            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query      = "select * from tbl_milestones where MilestonesID=@id";
                sqlConn.Command    = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@id", pid);

                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mileList.Add(new Admin.Models.Milestones.Milestones
                        {
                            MilestonesID          = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString()),
                            MilestonesTitle       = sqlConn.Reader["MilestonesTitle"].ToString(),
                            MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString(),
                            Status    = sqlConn.Reader["Status"].ToString(),
                            Deadline  = DateTime.Parse(sqlConn.Reader["Deadline"].ToString()),
                            CreatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                            UpdatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                {
                    sqlConn.Reader.Close();
                }
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();
            }

            return(mileList);
        }
Пример #2
0
        public List <Milestones> GetStatusName()
        {
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            Milestones            mile    = new Milestones();
            var mileList = new List <Milestones>();

            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query      = "select StatusID,Name from tbl_status";
                sqlConn.Command    = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                // sqlConn.Command.Parameters.AddWithValue("@id", sid);

                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mileList.Add(new Admin.Models.Milestones.Milestones
                        {
                            StatusID = Int32.Parse(sqlConn.Reader["StatusID"].ToString()),
                            Name     = sqlConn.Reader["Name"].ToString(),
                            //   MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString(),

                            //   CreatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                {
                    sqlConn.Reader.Close();
                }
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();
            }

            return(mileList);
        }
Пример #3
0
        public Milestones GetData(int mID)
        {
            Milestones mile = new Milestones();

            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query      = "select * from tbl_milestones where MilestonesID=@id";
                sqlConn.Command    = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@id", mID);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mile.ProjectID             = Int32.Parse(sqlConn.Reader["ProjectID"].ToString());
                        mile.MilestonesID          = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString());
                        mile.MilestonesTitle       = sqlConn.Reader["MilestonesTitle"].ToString();
                        mile.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();
                        mile.Deadline  = DateTime.Parse(sqlConn.Reader["Deadline"].ToString());
                        mile.Status    = sqlConn.Reader["Status"].ToString();
                        mile.UpdatedAt = DateTime.Parse(sqlConn.Reader["UpdatedAt"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                {
                    sqlConn.Reader.Close();
                }
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();
            }

            return(mile);
        }
Пример #4
0
        public Milestones Datamilestones(int pid)
        {
            Milestones data = new Milestones();

            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query      = "select ProjectID, MilestonesID,MilestonesTitle,MilestonesDescription from tbl_milestones where ProjectID=@ID";
                sqlConn.Command    = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@ID", pid);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        data.ProjectID             = Int32.Parse(sqlConn.Reader["ProjectID"].ToString());
                        data.MilestonesID          = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString());
                        data.MilestonesTitle       = sqlConn.Reader["MilestonesTitle"].ToString();
                        data.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();
                        data.Deadline = DateTime.Parse(sqlConn.Reader["Deadline"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                {
                    sqlConn.Reader.Close();
                }
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();
            }

            return(data);
        }
Пример #5
0
        public Milestones StatusNameByStatusId(int sid)
        {
            Milestones data = new Milestones();

            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query      = "select StatusID,Name from tbl_status where StatusID=@ID";
                sqlConn.Command    = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@ID", sid);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        data.StatusID = Int32.Parse(sqlConn.Reader["StatusID"].ToString());
                        data.Name     = sqlConn.Reader["Name"].ToString();
                        // data.MilestonesTitle = sqlConn.Reader["MilestonesTitle"].ToString();
                        // data.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                {
                    sqlConn.Reader.Close();
                }
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();
            }

            return(data);
        }
Пример #6
0
        public Milestones StatusNameByStatusId(int sid)
        {
            Milestones data = new Milestones();
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query = "select StatusID,Name from tbl_status where StatusID=@ID";
                sqlConn.Command = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@ID", sid);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        data.StatusID = Int32.Parse(sqlConn.Reader["StatusID"].ToString());
                        data.Name = sqlConn.Reader["Name"].ToString();
                       // data.MilestonesTitle = sqlConn.Reader["MilestonesTitle"].ToString();
                       // data.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();

                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                    sqlConn.Reader.Close();
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();

            }

            return data;
        }
Пример #7
0
        public List<Milestones> GetStatusName()
        {
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            Milestones mile = new Milestones();
            var mileList = new List<Milestones>();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query = "select StatusID,Name from tbl_status";
                sqlConn.Command = new SqlCommand(sqlConn.Query, sqlConn.Connection);
               // sqlConn.Command.Parameters.AddWithValue("@id", sid);

                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mileList.Add(new Admin.Models.Milestones.Milestones
                        {

                            StatusID = Int32.Parse(sqlConn.Reader["StatusID"].ToString()),
                            Name = sqlConn.Reader["Name"].ToString(),
                         //   MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString(),

                         //   CreatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                        });
                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                    sqlConn.Reader.Close();
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();

            }

            return mileList;
        }
Пример #8
0
        public List<Milestones> GetOnlyMilestones(int pid)
        {
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            Milestones mile = new Milestones();
            var mileList = new List<Milestones>();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query = "select * from tbl_milestones where MilestonesID=@id";
                sqlConn.Command = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@id", pid);

                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mileList.Add(new Admin.Models.Milestones.Milestones
                        {

                            MilestonesID = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString()),
                            MilestonesTitle = sqlConn.Reader["MilestonesTitle"].ToString(),
                            MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString(),
                            Status=sqlConn.Reader["Status"].ToString(),
                            Deadline = DateTime.Parse(sqlConn.Reader["Deadline"].ToString()),
                             CreatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                            UpdatedAt = DateTime.Parse(sqlConn.Reader["CreatedAt"].ToString()),
                        });
                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                    sqlConn.Reader.Close();
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();

            }

            return mileList;
        }
Пример #9
0
        public Milestones GetData(int mID)
        {
            Milestones mile = new Milestones();

            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query = "select * from tbl_milestones where MilestonesID=@id";
                sqlConn.Command = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@id", mID);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        mile.ProjectID = Int32.Parse(sqlConn.Reader["ProjectID"].ToString());
                        mile.MilestonesID = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString());
                        mile.MilestonesTitle = sqlConn.Reader["MilestonesTitle"].ToString();
                        mile.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();
                        mile.Deadline=DateTime.Parse(sqlConn.Reader["Deadline"].ToString());
                        mile.Status = sqlConn.Reader["Status"].ToString();
                        mile.UpdatedAt = DateTime.Parse(sqlConn.Reader["UpdatedAt"].ToString());

                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                    sqlConn.Reader.Close();
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();

            }

            return mile;
        }
Пример #10
0
        public Milestones Datamilestones(int pid)
        {
            Milestones data = new Milestones();
            SQLManager.SQLManager sqlConn = new SQLManager.SQLManager();
            try
            {
                sqlConn.Connection = new SqlConnection(sqlConn.ConnectionString);
                sqlConn.Query = "select ProjectID, MilestonesID,MilestonesTitle,MilestonesDescription from tbl_milestones where ProjectID=@ID";
                sqlConn.Command = new SqlCommand(sqlConn.Query, sqlConn.Connection);
                sqlConn.Command.Parameters.AddWithValue("@ID", pid);
                sqlConn.Connection.Open();

                using (sqlConn.Reader = sqlConn.Command.ExecuteReader())
                {
                    while (sqlConn.Reader.Read())
                    {
                        data.ProjectID = Int32.Parse(sqlConn.Reader["ProjectID"].ToString());
                        data.MilestonesID = Int32.Parse(sqlConn.Reader["MilestonesID"].ToString());
                        data.MilestonesTitle = sqlConn.Reader["MilestonesTitle"].ToString();
                        data.MilestonesDescription = sqlConn.Reader["MilestonesDescription"].ToString();
                        data.Deadline = DateTime.Parse(sqlConn.Reader["Deadline"].ToString());

                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (sqlConn.Reader != null)
                    sqlConn.Reader.Close();
                sqlConn.Connection.Close();
                sqlConn.Connection.Dispose();

            }

            return data;
        }