Beispiel #1
0
        public static object cDeleteAdo(MODEL.QueryModel obj)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@id", obj.ID);
            string sql = @"  
                  delete from test_system where id = @id  
             ";

            return(cSourceData.ExecuteData(sql, cmd));
        }
Beispiel #2
0
        public static object cSelectAdo(MODEL.QueryModel obj)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@id", obj.ID);
            string sql = @" 
                select ID,isnull(NAME,'') NAME ,isnull(EMAIL,'') EMAIL  from test_system where SYSTEM_NAME ='ado'
            ";

            return(cConverter.ConvertDataTable <MODEL.QueryModel>(cSourceData.GetData(sql, cmd).Tables[0]));
        }
Beispiel #3
0
        public static object cInsertAdo(MODEL.QueryModel obj)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@name", obj.NAME);
            cmd.Parameters.AddWithValue("@email", obj.EMAIL);
            string sql = @"  
               insert into test_system(name,email,SYSTEM_NAME)values(@name,@email,'ado')  
             ";

            return(cSourceData.ExecuteData(sql, cmd));
        }
Beispiel #4
0
        public static object cUpdateAdo(MODEL.QueryModel obj)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@id", obj.ID);
            cmd.Parameters.AddWithValue("@name", obj.NAME);
            cmd.Parameters.AddWithValue("@email", obj.EMAIL);
            string sql = @" 
                update test_system
                set name = @name,
                    email = @email ,
                    SYSTEM_NAME ='ado'
                where id=@id
                
            ";

            return(cSourceData.ExecuteData(sql, cmd));
        }
Beispiel #5
0
 public static object cDeleteAdo(MODEL.QueryModel data)
 {
     return(DAL.QueryAdoDAL.cDeleteAdo(data));
 }
Beispiel #6
0
 public static object cInsertAdo(MODEL.QueryModel data)
 {
     return(DAL.QueryAdoDAL.cInsertAdo(data));
 }
Beispiel #7
0
 public static object cDeleteAdo(string data)
 {
     MODEL.QueryModel obj = cHelper.Deserialize <MODEL.QueryModel>(data);
     return(DAL.QueryAdoDAL.cDeleteAdo(obj));
 }