zoukankan      html  css  js  c++  java
  • C#评分小系统练习

    一个经理类

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace WindowsFormsApplication1
    {
        class PM
        {
            private int num;
    
            public int Num
            {
                get { return num; }
                set { num = value; }
            }
            private string name;
    
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
            private int age;
    
            public int Age
            {
                get { return age; }
                set { age = value; }
            }
            private string sex;
    
            public string Sex
            {
                get { return sex; }
                set { sex = value; }
            }
            private string zl;
    
            public string Zl
            {
                get { return zl; }
                set { zl = value; }
            }
            public void ShowJudge(SE se, string assess, string  score)
            {
    
                se.Assess = assess;
                se.Score = score;
    
            }
            
    
        }
      
    }
    

      //建立一个员工类

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace WindowsFormsApplication1
    {
        class SE
        {
            private string  num;
    
            public string Num
            {
                get { return num; }
                set { num = value; }
            }
            private string name="0";
    
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
            private string age;
    
            public string Age
            {
                get { return age; }
                set { age = value; }
            }
            private string sex="";
    
            public string Sex
            {
                get { return sex; }
                set { sex = value; }
            }
            private int popular;
    
            public int Popular
            {
                get { return popular; }
                set { popular = value; }
            }
            private string assess="";
    
            public string Assess
            {
                get { return assess; }
                set { assess = value; }
            }
            private string  score;
    
            public string  Score
            {
                get { return score; }
                set { score = value; }
            }
    
        }
    }
    

      //显示窗口及评分窗口

    //form1代码

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class One : Form
        {
            public One()
            {
                InitializeComponent();
            }
            public string name2;
            public string ass;
            public string score;
    
            two frn = new two();
            SE[] se = new SE[3];
            private void Form1_Load(object sender, EventArgs e)
            {
    
                SE see = new SE();
                see.Num = "111";
                see.Name = "张三";
                see.Age = "26";
                SE sew = new SE();
                sew.Num ="112";
                sew.Name="周新宇";
                sew.Age="22";
                SE seq = new SE();
                seq.Num="113";
                seq.Name = "李四";
                seq.Age = "30";
    
                see.Assess = "未评价";
                sew.Assess = "未评价";
                seq.Assess = "未评价";
                see.Score = "";
                sew.Score = "";
                seq.Score = "";
                se[0] = see;
                se[1] = sew;
                se[2] = seq;
                MessageBox.Show(name2);
                for (int i = 0; i < se.Length; i++)
                {
    
                    ListViewItem ls = new ListViewItem(se[i].Num);
                    ls.SubItems.Add(se[i].Name);
                    ls.SubItems.Add(se[i].Age);
                    ls.SubItems.Add(se[i].Assess);
                    ls.SubItems.Add(se[i].Score);
                    this.listView1.Items.Add(ls);
                }
                
                    for (int i = 0; i < se.Length; i++)
                {
                    if (listView1.Items[i].SubItems[1].Text.ToString().Equals(name2) ){
                        MessageBox.Show(ass);
                        listView1.Items[i].SubItems[3].Text = ass;
                        listView1.Items[i].SubItems[4].Text = score;
                    }
    
                }
    
              
            }
    
            private void listView1_DoubleClick(object sender, EventArgs e)
            {
              
                frn.name = listView1.SelectedItems[0].SubItems[1].Text;
                frn.ass = listView1.SelectedItems[0].SubItems[3].Text;
                frn.score = listView1.SelectedItems[0].SubItems[4].Text;
                frn.Show();
                this.Hide();
            }
        }
    }
    

      //Form2代码

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class two : Form
        {
    
            
            public string name;
            public string ass;
            public string score;
            public two()
            {
                InitializeComponent();
            }
    
            private void Form2_Load(object sender, EventArgs e)
            {
                One fr = new One();
                textBox1.Text = name;
                textBox2.Text = ass;
                textBox3.Text = score;
    
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                    name = textBox1.Text;
                    ass = textBox2.Text;
                    score = textBox2.Text;
                   
                    One fr = new One();
                    fr.name2 = textBox1.Text;
                    fr.ass = textBox2.Text;
                    fr.score = textBox3.Text;
                    fr.Show();
                    this.Hide();
                   
                 
            }
    
          
        }
    }
    

      

  • 相关阅读:
    java的几种对象(PO,VO,DAO,BO,POJO)
    建立标准编码规则(四)-C#编码规范分类及实现
    建立标准编码规则(三)-CodeFixProvider 给代码分析器增加修复建议
    建立标准编码规则(二)-DiagnosticAnalyzer 增加诊断分析代码
    建立标准编码规则(一)-自定义C#代码分析器
    领域模型与微服务
    asp.net core 中使用StyleCop.StyleCopAnalyzers
    asp.net core中使用HttpClient实现Post和Get的同步异步方法
    asp.net core 如何集成kindeditor并实现图片上传功能
    一名前端Web架构师的成长之路(转载)
  • 原文地址:https://www.cnblogs.com/sunbin123/p/6567321.html
Copyright © 2011-2022 走看看