예제 #1
0
        /// <summary>
        /// 删除地区
        /// </summary>
        /// <param name="en">地区</param>
        /// <returns></returns>
        public int delete(AreaInfo en)
        {
            string strSql = "delete from AreaInfo where id=@id";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@id", en.id)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
예제 #2
0
        /// <summary>
        /// 添加地区
        /// </summary>
        /// <param name="en">地区</param>
        /// <returns></returns>
        public int add(AreaInfo en)
        {
            string strSql = "insert into AreaInfo (name, memo) values (@name, @memo)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@name", en.name),
                new SqlParameter("@memo", en.memo)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
예제 #3
0
        /// <summary>
        /// 修改地区
        /// </summary>
        /// <param name="en">地区</param>
        /// <returns></returns>
        public int update(AreaInfo en)
        {
            string strSql = "update AreaInfo set name=@name, memo=@memo where id=@id";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@id", en.id),
                new SqlParameter("@name", en.name),
                new SqlParameter("@memo", en.memo)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
예제 #4
0
        /// <summary>
        /// 删除地区
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult Area_remove(string id)
        {
            AreaInfo en = new AreaInfo();
            en.id = Convert.ToInt32(id);

            DaAreaInfo dal = new DaAreaInfo();
            var result = new CustomJsonResult();
            result.Data = dal.delete(en);
            return result;
        }
예제 #5
0
        public JsonResult Area_edit(string id, string name, string memo)
        {
            AreaInfo en = new AreaInfo();
            en.id = Convert.ToInt32(id);
            en.name = name;
            en.memo = memo;

            DaAreaInfo dal = new DaAreaInfo();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }
예제 #6
0
        public JsonResult Area_add(string name, string memo)
        {
            AreaInfo en = new AreaInfo();
            en.name = name;
            en.memo = memo;

            DaAreaInfo dal = new DaAreaInfo();
            var result = new CustomJsonResult();
            result.Data = dal.add(en);
            return result;
        }