[HttpPost]
public void AddInfo(UserInfoModel use)
{
string json = JsonConvert.SerializeObject(use);
//加载程序集 获取dll文件地址
Assembly assmbly = Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "bin/Dal.dll");
//获取类型 参数
Type type = assmbly.GetType("Dal.UserInfoDal");
//创建该类的实例 object类型 参数
object inser = assmbly.CreateInstance("Dal.UserInfoDal");
//设置该方法的参数类型,Type[]类型
Type [] params_Type = new Type[1];
//params_Type[0] = Type.GetType("System.String");
//设置该方法的参数值,如果多个参数可以追加多个
Object[] paras = new Object[1];
paras[0] = use;
use.XingZhiID = Convert.ToInt32(use.XingZhiID);
use.DongHao = Convert.ToInt32(use.DongHao);
use.HuXingID = Convert.ToInt32(use.HuXingID);
use.JID = Convert.ToInt32(use.JID);
use.XingZhiID = Convert.ToInt32(use.XingZhiID);
use.ZhuangTaiID = Convert.ToInt32(use.ZhuangTaiID);
if (bll.Add(use) > 0)
{
Response.Write("<script>alert('添加成功!');location.href='/Index/Index'</script>");
}
else
{
Response.Write("<script>alert('添加失败!');location.href='/Index/Index'</script>");
}
}