예제 #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            if (!CheckData())
            {
                return;
            }
            if (tabData != null)
            {
                DataRow[] matchs = tabData.Select("Level='" + level + "'");
                if (matchs.Length > 0)
                {
                    MessageBox.Show("效益层级已经存在", "信息提示", MessageBoxButtons.OK);
                    return;
                }
            }

            PerformanceBean b = new PerformanceBean();

            b.Level      = level;
            b.BaseSalary = salary;

            PerformanceDAO d = new PerformanceDAO();

            d.AddPerformance(b);

            LoadData();
        }
예제 #2
0
 public StaffBean()
 {
     post        = new PostBean();
     performance = new PerformanceBean();
     benefit     = new BenefitBean();
     department  = new DepartmentBean();
 }
예제 #3
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (id == -1)
            {
                return;
            }
            PerformanceBean b = new PerformanceBean();

            b.Id = id;

            PerformanceDAO d = new PerformanceDAO();

            d.DeletePerformance(b);

            LoadData();
        }
예제 #4
0
        public int DeletePerformance(PerformanceBean b)
        {
            int count = 0;

            try
            {
                SqlParameter[] sp =
                {
                    para = new SqlParameter("@Id", b.Id),
                };
                count = sh.RunSql("PR_Performance_Delete", sp);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(count);
        }
예제 #5
0
        private SqlParameter para; //参数

        public int AddPerformance(PerformanceBean b)
        {
            int count = 0;

            try
            {
                SqlParameter[] sp =
                {
                    para = new SqlParameter("@Level",      b.Level),
                    para = new SqlParameter("@BaseSalary", b.BaseSalary),
                };
                count = sh.RunSql("PR_Performance_Add", sp);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(count);
        }