コード例 #1
0
        public static void InsertTable(ENTPRJPROJECTTASKRESOURSE prjtskrsrs)//Veri ekliyoruz.
        {
            try
            {
                con = SQL.GetConnection();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                cmd = SQL.SetCommand("INSERT INTO PRJ_PROJECTTASKRESOURSE (ID,PROJECTTASKID,USERID,DURATION,TYPEPROJECTRESOURSESTATUSID) VALUES (@ID,@PROJECTTASKID,@USERID,@DURATION,@TYPEPROJECTRESOURSESTATUSID)", con);
                cmd.Parameters.AddWithValue("@ID", prjtskrsrs.ID);
                cmd.Parameters.AddWithValue("@PROJECTTASKID", prjtskrsrs.PROJECTTASKID);
                cmd.Parameters.AddWithValue("@USERID", prjtskrsrs.USERID);
                cmd.Parameters.AddWithValue("@DURATION", prjtskrsrs.DURATION);
                cmd.Parameters.AddWithValue("@TYPEPROJECTRESOURSESTATUSID", prjtskrsrs.TYPEPROJECTRESOURSESTATUSID);
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
            }
        }
 public static void UpdateComplete(ENTPRJPROJECTTASKRESOURSE ptskrsrs)
 {
     con = SQL.GetConnection();
     cmd = SQL.SetCommand("UPDATE PRJ_PROJECTTASKRESOURSE SET TYPEPROJECTRESOURSESTATUSID=@TYPEPROJECTRESOURSESTATUSID WHERE ID = @ID", con);
     cmd.Parameters.AddWithValue("@ID", ptskrsrs.ID);
     cmd.Parameters.AddWithValue("@TYPEPROJECTRESOURSESTATUSID", ptskrsrs.TYPEPROJECTRESOURSESTATUSID);
     con.Open();
     cmd.ExecuteNonQuery();
     con.Close();
 }
コード例 #3
0
        public static ENTPRJPROJECTTASKRESOURSE GetValueTaskResourseNotVW(Guid ID)//Id getiriyorum detaildaki labellara yazdırmak için
        {
            con = SQL.GetConnection();
            cmd = SQL.SetCommand("SELECT * FROM PRJ_PROJECTTASKRESOURSE WHERE ID=@ID", con);
            cmd.Parameters.AddWithValue("@ID", ID);

            con.Open();
            SqlDataReader             dr       = cmd.ExecuteReader();
            ENTPRJPROJECTTASKRESOURSE ptskrsrs = null;
            byte?Duration = null;

            while (dr.Read())
            {
                if (!string.IsNullOrEmpty(dr["DURATION"].ToString()))
                {
                    Duration = Convert.ToByte(dr["DURATION"].ToString());
                }
                ptskrsrs = new ENTPRJPROJECTTASKRESOURSE(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTTASKID"].ToString()), Guid.Parse(dr["USERID"].ToString()), Duration, byte.Parse(dr["TYPEPROJECTRESOURSESTATUSID"].ToString()));
                break;
            }
            con.Close();
            return(ptskrsrs);
        }
コード例 #4
0
        public static List <ENTPRJPROJECTTASKRESOURSE> GetAllListFirmResoursesID(Guid USERID)
        {
            con = SQL.GetConnection();
            cmd = SQL.SetCommand("SELECT * FROM PRJ_PROJECTTASKRESOURSE WHERE USERID=@USERID", con);
            cmd.Parameters.AddWithValue("@USERID", USERID);
            con.Open();
            SqlDataReader             dr   = cmd.ExecuteReader();
            ENTPRJPROJECTTASKRESOURSE ptsk = null;
            byte?Duration = null;
            List <ENTPRJPROJECTTASKRESOURSE> ptsklist = new List <ENTPRJPROJECTTASKRESOURSE>();

            while (dr.Read())
            {
                if (!string.IsNullOrEmpty(dr["DURATION"].ToString()))
                {
                    Duration = Convert.ToByte(dr["DURATION"].ToString());
                }
                ptsk = new ENTPRJPROJECTTASKRESOURSE(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTTASKID"].ToString()), Guid.Parse(dr["USERID"].ToString()), Duration, byte.Parse(dr["TYPEPROJECTRESOURSESTATUSID"].ToString()));
                ptsklist.Add(ptsk);
            }
            con.Close();

            return(ptsklist);
        }
コード例 #5
0
        public static ENTPRJPROJECTTASKRESOURSE GetValueComplete(Guid PROJECTTASKID, Guid USERID)
        {
            con = SQL.GetConnection();
            cmd = SQL.SetCommand("SELECT * FROM PRJ_PROJECTTASKRESOURSE WHERE PROJECTTASKID=@PROJECTTASKID AND USERID=@USERID", con);
            cmd.Parameters.AddWithValue("@PROJECTTASKID", PROJECTTASKID);
            cmd.Parameters.AddWithValue("@USERID", USERID);

            con.Open();
            SqlDataReader             dr       = cmd.ExecuteReader();
            ENTPRJPROJECTTASKRESOURSE ptskrsrs = null;
            byte?Duration = null;

            while (dr.Read())
            {
                if (!string.IsNullOrEmpty(dr["DURATION"].ToString()))
                {
                    Duration = Convert.ToByte(dr["DURATION"].ToString());
                }
                ptskrsrs = new ENTPRJPROJECTTASKRESOURSE(Guid.Parse(dr["ID"].ToString()), Guid.Parse(dr["PROJECTTASKID"].ToString()), Guid.Parse(dr["USERID"].ToString()), Duration, byte.Parse(dr["TYPEPROJECTRESOURSESTATUSID"].ToString()));
                break;
            }
            con.Close();
            return(ptskrsrs);
        }