Exemplo n.º 1
0
        private void btnDele_Click(object sender, EventArgs e)
        {
            JiangFaTypesBLL   JiangFa = new JiangFaTypesBLL();
            JiangFaTypesModel model   = new JiangFaTypesModel();

            if (this.dataGridView2.SelectedRows.Count > 0)
            {
                int ID = Convert.ToInt32(this.dataGridView2.SelectedRows[0].Cells["奖罚类型编号"].Value);
                model.PunishmentAwardTypes_ID = ID;
                JiangFa.DeleJiangFaTypes(model);
                GetAllJiangFaTypes();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加奖罚类型
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            JiangFaTypesModel model   = new JiangFaTypesModel();
            JiangFaTypesBLL   JiangFa = new JiangFaTypesBLL();
            string            name    = this.cboName.SelectedItem.ToString();
            object            max     = JiangFa.GetMaxJiangFaTypes();
            object            min     = JiangFa.GetMinJiangFaTypes();
            int id = 0;

            if (name == "奖励")
            {
                if (string.IsNullOrEmpty(max.ToString()))
                {
                    id = 1;
                }
                else if (Convert.ToInt32(max) < 0)
                {
                    id = 1;
                }
                else
                {
                    id = Convert.ToInt32(max) + 1;
                }
            }
            else
            {
                if (string.IsNullOrEmpty(min.ToString()))
                {
                    id = -1;
                }
                else if (Convert.ToInt32(min) > 0)
                {
                    id = -1;
                }
                else
                {
                    id = Convert.ToInt32(min) - 1;
                }
            }
            model.PunishmentAwardTypes_ID   = id;
            model.PunishmentAwardTypes_Name = this.txtName.Text;
            JiangFa.AddJiangFaTypes(model);
            GetAllJiangFaTypes();
        }
Exemplo n.º 3
0
 /// <summary>
 /// 查询指定学生惩罚记录
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public DataTable GetFaTypes(JiangFaTypesModel model)
 {
     return(JiangFa.GetFaTypes(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 删除奖罚类型的业务方法
 /// </summary>
 /// <param name="model">奖罚类型的实体对象</param>
 public void DeleJiangFaTypes(JiangFaTypesModel model)
 {
     JiangFa.DeleJiangFaTypes(model);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 添加奖罚类型的业务方法
 /// </summary>
 /// <param name="model">奖罚类型的实体对象</param>
 public void AddJiangFaTypes(JiangFaTypesModel model)
 {
     JiangFa.AddJiangFaTypes(model);
 }
Exemplo n.º 6
0
        /// <summary>
        /// 查询指定学生奖励记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public DataTable GetJiangTypes(JiangFaTypesModel model)
        {
            string sql = "select * from PunishmentAwardTypes where  PunishmentAwardTypes_ID>0";

            return(SqlHelper.GetDataTable(sql));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 删除奖罚类型的数据访问方法
        /// </summary>
        /// <param name="model">奖罚类型的实体对象</param>
        public void DeleJiangFaTypes(JiangFaTypesModel model)
        {
            string sql = "delete PunishmentAwardTypes where PunishmentAwardTypes_ID=@0";

            SqlHelper.ExNonQuery(sql, "删除奖罚类型", model.PunishmentAwardTypes_ID);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 添加奖罚类型的数据访问方法
        /// </summary>
        /// <param name="model">奖罚类型的实体对象</param>
        public void AddJiangFaTypes(JiangFaTypesModel model)
        {
            string sql = "insert into PunishmentAwardTypes values(@0,@1)";

            SqlHelper.ExNonQuery(sql, "添加奖罚类型", model.PunishmentAwardTypes_ID, model.PunishmentAwardTypes_Name);
        }