public static ENTVWPRJPROJECTTASKRESOURCE GetValueTaskResourse(Guid ID)//Id getiriyorum detaildaki labellara yazdırmak için { con = SQL.GetConnection(); cmd = SQL.SetCommand("SELECT * FROM VW_PRJ_ProjectTaskResource WHERE ID=@ID", con); cmd.Parameters.AddWithValue("@ID", ID); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); ENTVWPRJPROJECTTASKRESOURCE ptskrsrs = null; byte?Duration = null; while (dr.Read()) { if (!string.IsNullOrEmpty(dr["DURATION"].ToString())) { Duration = Convert.ToByte(dr["DURATION"].ToString()); } ptskrsrs = new ENTVWPRJPROJECTTASKRESOURCE(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTTASKID"].ToString()), Guid.Parse(dr["USERID"].ToString()), byte.Parse(dr["TYPEPROJECTRESOURSESTATUSID"].ToString()), Duration, dr["PROJECTTASKNAME"].ToString(), Convert.ToDateTime(dr["PROJECTTASKCREATEDATE"].ToString()), dr["USERFULLNAME"].ToString(), dr["TYPEPROJECTRESOURSESTATUSNAME"].ToString()); break; } con.Close(); return(ptskrsrs); }
public static List <ENTVWPRJPROJECTTASKRESOURCE> GetAllListProjectsTaskResourse(Guid PROJECTTASKID)//Verileri listeliyoruz. { con = SQL.GetConnection(); cmd = SQL.SetCommand("SELECT * FROM VW_PRJ_ProjectTaskResource WHERE PROJECTTASKID=@PROJECTTASKID", con); cmd.Parameters.AddWithValue("@PROJECTTASKID", PROJECTTASKID); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); ENTVWPRJPROJECTTASKRESOURCE tskrsrs = null; byte?duration = null; List <ENTVWPRJPROJECTTASKRESOURCE> ptskrsrlist = new List <ENTVWPRJPROJECTTASKRESOURCE>(); while (dr.Read()) { if (!string.IsNullOrEmpty(dr["DURATION"].ToString())) { duration = Convert.ToByte(dr["DURATION"].ToString()); } tskrsrs = new ENTVWPRJPROJECTTASKRESOURCE(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTTASKID"].ToString()), Guid.Parse(dr["USERID"].ToString()), byte.Parse(dr["TYPEPROJECTRESOURSESTATUSID"].ToString()), duration, dr["PROJECTTASKNAME"].ToString(), Convert.ToDateTime(dr["PROJECTTASKCREATEDATE"].ToString()), dr["USERFULLNAME"].ToString(), dr["TYPEPROJECTRESOURSESTATUSNAME"].ToString()); ptskrsrlist.Add(tskrsrs); } con.Close(); return(ptskrsrlist); }