예제 #1
0
        /// <summary>
        /// 删除状态
        /// </summary>
        /// <param name="en">状态</param>
        /// <returns></returns>
        public int delete(CustomerState en)
        {
            string strSql = "delete from CustomerState 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(CustomerState en)
        {
            string strSql = "insert into CustomerState (state, memo) values (@state, @memo)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@state", en.state),
                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(CustomerState en)
        {
            string strSql = "update CustomerState set state=@state, memo=@memo where id=@id";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@id", en.id),
                new SqlParameter("@state", en.state),
                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 CustomerState_remove(string id)
        {
            CustomerState en = new CustomerState();
            en.id = Convert.ToInt32(id);

            DaCustomerState dal = new DaCustomerState();
            var result = new CustomJsonResult();
            result.Data = dal.delete(en);
            return result;
        }
예제 #5
0
        public JsonResult CustomerState_edit(string id, string state, string memo)
        {
            CustomerState en = new CustomerState();
            en.id = Convert.ToInt32(id);
            en.state = state;
            en.memo = memo;

            DaCustomerState dal = new DaCustomerState();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }
예제 #6
0
        public JsonResult CustomerState_add(string state, string memo)
        {
            CustomerState en = new CustomerState();
            en.state = state;
            en.memo = memo;

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