Пример #1
0
        public static List <ENTVWPRJPROJECTTASK> GetAllListProjectsTasks(Guid PROJECTID)
        {
            con = SQL.GetConnection();
            cmd = SQL.SetCommand("SELECT * FROM VW_PRJ_ProjectTask WHERE PROJECTID=@PROJECTID ORDER BY CREATEDATE DESC", con);
            cmd.Parameters.AddWithValue("@PROJECTID", PROJECTID);
            con.Open();
            SqlDataReader              dr       = cmd.ExecuteReader();
            ENTVWPRJPROJECTTASK        ptsk     = null;
            DateTime?                  dueDate  = null;
            List <ENTVWPRJPROJECTTASK> ptsklist = new List <ENTVWPRJPROJECTTASK>();

            while (dr.Read())
            {
                dueDate = null;
                if (!string.IsNullOrEmpty(dr["DUEDATE"].ToString()))
                {
                    dueDate = Convert.ToDateTime(dr["DUEDATE"].ToString());
                }
                ptsk = new ENTVWPRJPROJECTTASK(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTID"].ToString()), dr["NAME"].ToString(), dr["DESCRIPTION"].ToString(), Byte.Parse(dr["TYPEPROJECTTASKSTATUSID"].ToString()), Convert.ToDateTime(dr["CREATEDATE"].ToString()), dueDate, dr["TYPEPROJECTTASKSTATUSNAME"].ToString(), bool.Parse(dr["TYPEPROJECTTASKSTATUSISOPEN"].ToString()), dr["PROJECTNAME"].ToString());//ısopen ekledim kontrol et
                ptsklist.Add(ptsk);
            }
            con.Close();

            return(ptsklist);
        }
Пример #2
0
        public static ENTVWPRJPROJECTTASK GetValueTask(Guid ID)//Id getiriyorum detaildaki labellara yazdırmak için
        {
            con = SQL.GetConnection();
            cmd = SQL.SetCommand("SELECT * FROM VW_PRJ_ProjectTask WHERE ID=@ID", con);
            cmd.Parameters.AddWithValue("@ID", ID);

            con.Open();
            SqlDataReader       dr      = cmd.ExecuteReader();
            ENTVWPRJPROJECTTASK ptsk    = null;
            DateTime?           dueDate = null;
            Guid PROJECTID;

            while (dr.Read())
            {
                dueDate = null;
                if (!string.IsNullOrEmpty(dr["DUEDATE"].ToString()))
                {
                    dueDate = Convert.ToDateTime(dr["DUEDATE"].ToString());
                }
                PROJECTID = Guid.Parse(dr["PROJECTID"].ToString());
                ptsk      = new ENTVWPRJPROJECTTASK(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTID"].ToString()), dr["NAME"].ToString(), dr["DESCRIPTION"].ToString(), Byte.Parse(dr["TYPEPROJECTTASKSTATUSID"].ToString()), Convert.ToDateTime(dr["CREATEDATE"].ToString()), dueDate, dr["TYPEPROJECTTASKSTATUSNAME"].ToString(), Convert.ToBoolean(dr["TYPEPROJECTTASKSTATUSISOPEN"].ToString()), dr["PROJECTNAME"].ToString());
                break;
            }
            con.Close();
            return(ptsk);
        }