Exemplo n.º 1
0
        /// <summary>
        ///[commissionList]表查询实体的方法
        /// </summary>
        public static CommissionList getCommissionListById(int id)
        {
            CommissionList commissionlist = null;

            string sql = "select * from commissionList where id=@id";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@id", id)
            };
            DataTable dt = DBHelper.GetDataSet(sql, sp);

            if (dt.Rows.Count > 0)
            {
                commissionlist = new CommissionList();
                foreach (DataRow dr in dt.Rows)
                {
                    commissionlist.Id         = Convert.ToInt32(dr["id"]);
                    commissionlist.Task       = Convert.ToString(dr["task"]);
                    commissionlist.Commission = Convert.ToString(dr["commission"]);
                }
            }

            return(commissionlist);
        }
Exemplo n.º 2
0
        /// <summary>
        ///[commissionList]表添加的方法
        /// </summary>
        public static int addCommissionList(CommissionList commissionlist)
        {
            string sql = "insert into commissionList([task],[commission]) values (@task,@commission)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@task", commissionlist.Task),
                new SqlParameter("@commission", commissionlist.Commission)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
Exemplo n.º 3
0
        /// <summary>
        ///[commissionList]表修改的方法
        /// </summary>
        public static int updateCommissionListById(CommissionList commissionlist)
        {
            string sql = "update commissionList set task=@task,commission=@commission where id=@id";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@id", commissionlist.Id),
                new SqlParameter("@task", commissionlist.Task),
                new SqlParameter("@commission", commissionlist.Commission)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
Exemplo n.º 4
0
        /// <summary>
        ///根据SQL语句获取实体
        /// </summary>
        public static CommissionList getCommissionListBySql(string sql)
        {
            CommissionList commissionlist = null;
            DataTable      dt             = DBHelper.GetDataSet(sql);

            if (dt.Rows.Count > 0)
            {
                commissionlist = new CommissionList();
                foreach (DataRow dr in dt.Rows)
                {
                    commissionlist.Id         = Convert.ToInt32(dr["id"]);
                    commissionlist.Task       = Convert.ToString(dr["task"]);
                    commissionlist.Commission = Convert.ToString(dr["commission"]);
                }
            }
            return(commissionlist);
        }
Exemplo n.º 5
0
 public static int addCommissionList(CommissionList commissionlist)
 {
     return(CommissionListService.addCommissionList(commissionlist));
 }
Exemplo n.º 6
0
 public static int updateCommissionList(CommissionList commissionlist)
 {
     return(CommissionListService.updateCommissionListById(commissionlist));
 }