Ejemplo n.º 1
0
        private void updateevaluateperformanceidcomboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            string pid = updateevaluateperformanceidcomboBox.Text;
            p = pds.GetPerformance(pid);

            updateevaluatereviewcommenttext.Text = p.reviewComment;
            updateReviewDatetime.Value = p.reviewDate;
        }
Ejemplo n.º 2
0
       public bool updatePerformance(Performance obj)
       {
           string insertCommand = "update performance set ReviewComment=@ReviewComment,ReviewDate=@ReviewDate,ReviewByAdminId=@ReviewByAdminId " +
                                  " where employeeId=@EmployeeId and performanceId=@performanceId";
           SqlCommand command = new SqlCommand(insertCommand);
           SqlParameter idParameter = new SqlParameter("@EmployeeId", SqlDbType.NVarChar, 50);
           idParameter.Value = obj.employeeId;
           SqlParameter performanceidParameter = new SqlParameter("@performanceId", SqlDbType.NVarChar, 50);
           performanceidParameter.Value = obj.PerformanceId;
           SqlParameter ReviewCommentParameter = new SqlParameter("@ReviewComment", SqlDbType.NVarChar, 50);
           @ReviewCommentParameter.Value = obj.reviewComment;
           SqlParameter ReviewDateParameter = new SqlParameter("@ReviewDate", SqlDbType.Date);
           @ReviewDateParameter.Value = obj.reviewDate;

           SqlParameter ReviewByAdminIdParameter = new SqlParameter("@ReviewByAdminId", SqlDbType.NVarChar, 50);
           ReviewByAdminIdParameter.Value = obj.reviewByAdmin;







           command.Parameters.Add(idParameter);
           command.Parameters.Add(performanceidParameter);
           command.Parameters.Add(ReviewCommentParameter);
           command.Parameters.Add(ReviewDateParameter);
           command.Parameters.Add(ReviewByAdminIdParameter);



           if (da.Execution(command))
           {
               return true;
           }
           else
           {
               return false;
           }
       }
Ejemplo n.º 3
0
       public bool insertPerformance(Performance obj)
       {
           string insertCommand = "INSERT INTO performance (EmployeeId,performanceId,ReviewComment,ReviewDate,ReviewByAdminId) " +
                                  "VALUES (@EmployeeId,@performanceId,@ReviewComment,@ReviewDate,@ReviewByAdminId)";
           SqlCommand command = new SqlCommand(insertCommand);
           SqlParameter idParameter = new SqlParameter("@EmployeeId", SqlDbType.NVarChar, 50);
           idParameter.Value = obj.employeeId;
           SqlParameter performanceidParameter = new SqlParameter("@performanceId", SqlDbType.NVarChar, 50);
           performanceidParameter.Value = obj.PerformanceId;
           SqlParameter ReviewCommentParameter = new SqlParameter("@ReviewComment", SqlDbType.NVarChar, 50);
           ReviewCommentParameter.Value = obj.reviewComment;
           SqlParameter ReviewDateParameter = new SqlParameter("@ReviewDate", SqlDbType.Date);
           ReviewDateParameter.Value = obj.reviewDate;

           SqlParameter ReviewByAdminIdParameter = new SqlParameter("@ReviewByAdminId", SqlDbType.NVarChar, 50);
           ReviewByAdminIdParameter.Value = obj.reviewByAdmin;
          






           command.Parameters.Add(idParameter);
           command.Parameters.Add(performanceidParameter);
           command.Parameters.Add(ReviewCommentParameter);
           command.Parameters.Add(ReviewDateParameter);
           command.Parameters.Add(ReviewByAdminIdParameter);
         


           if (da.Execution(command))
           {
               return true;
           }
           else
           {
               return false;
           }
       }
Ejemplo n.º 4
0
       public List<Performance> GetPerformanceList()
       {
           List<Performance> performanceList = new List<Performance>();

           string query = "select EmployeeId,performanceId,ReviewComment,ReviewDate,ReviewByAdminId from performance";
           SqlCommand cmd = da.GetCommand(query);
           cmd.Connection.Open();
           SqlDataReader reader = cmd.ExecuteReader();

           while (reader.Read())
           {
               Performance ej = new Performance();

               ej.employeeId = reader.GetString(0);
               ej.PerformanceId = reader.GetString(1);
               ej.reviewComment = reader.GetString(2);
               ej.reviewDate = reader.GetDateTime(3);
               ej.reviewByAdmin = reader.GetString(4);
              

               performanceList.Add(ej);
           }
           return performanceList;
       }
Ejemplo n.º 5
0
       public Performance GetPerformance(string perid)
       {
           Performance p = new Performance();
           string query = "select ReviewComment,ReviewDate from performance where performanceId= '" + perid + "'";
           SqlCommand cmd = da.GetCommand(query);
           cmd.Connection.Open();
           SqlDataReader reader = cmd.ExecuteReader();

           while (reader.Read())
           {

               p.reviewComment = reader.GetString(0);
               p.reviewDate = reader.GetDateTime(1);


           }
           return p;
       }
Ejemplo n.º 6
0
       public bool deletePerformance(Performance obj)
       {
           string insertCommand = "delete from performance " +
                                  " where EmployeeId=@EmployeeId and performanceId=@performanceId ";
           SqlCommand command = new SqlCommand(insertCommand);
           SqlParameter employeeIdParameter = new SqlParameter("@EmployeeId", SqlDbType.NVarChar, 50);
           employeeIdParameter.Value = obj.employeeId;
           SqlParameter performanceIdParameter = new SqlParameter("@performanceId", SqlDbType.NVarChar, 50);
           performanceIdParameter.Value = obj.PerformanceId;


           command.Parameters.Add(employeeIdParameter);
           command.Parameters.Add(performanceIdParameter);


           if (da.Execution(command))
           {
               return true;
           }
           else
           {
               return false;
           }

       }