using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;

namespace BLL
{
    public class UserBll
    {
        public DataTable gettable(string sql)
        {
           return DBHelper.ExecuteAsDataTable(sql, null);
        }
        public DataTable Stocktaking(string ProName)
        {
            DBHelper.Parameter[] par ={ new DBHelper.Parameter("@Condition", DbType.String, 50, ParameterDirection.Input, ProName)};
            DBHelper.OutputParameter Outpar = null;
            return DBHelper.ExecuteStoredProcedureWithQuery("PROC_stocktaking",ref Outpar, par).Tables[0];
        }
        public int update(string TableName, string value, string Condition)
        {
            DBHelper.OutputParameter OutPara = null;
            DBHelper.Parameter[] para ={
                                         new DBHelper.Parameter("@TableName",DbType.String,50,ParameterDirection.Input,TableName),
                                         new DBHelper.Parameter("@SetValue",DbType.String,200,ParameterDirection.Input,value),
                                         new DBHelper.Parameter("@Condition",DbType.String,100,ParameterDirection.Input,Condition)
                                         
                                     };
            return DBHelper.ExecuteStoredProcedureNonQuery("pro_Update", ref OutPara, para);
        }
    }
}
