后台调用存储过程

 1 public JsonResult GetResult(string p_account_month_to)
 2 
 3 {
 4 
 5 SqlParameter[] param =
 6 
 7 {
 8 
 9 new SqlParameter("@p_org_info_id ", SqlDbType.Int),
10 
11 new SqlParameter("@p_customer_info_id ", SqlDbType.Int),
12 
13 new SqlParameter("@p_account_month_from", SqlDbType.VarChar, 6),
14 
15 new SqlParameter("@p_account_month_to", SqlDbType.VarChar, 6),
16 
17 new SqlParameter("@p_user_name", SqlDbType.VarChar, 50),
18 
19 new SqlParameter("@p_feedback", SqlDbType.VarChar, 500)
20 
21 };
22 
23 param[0].Value = base.org_info_id;
24 
25 param[1].Value = base.customer_info_id;
26 
27 param[2].Value = "";
28 
29 param[3].Value = p_account_month_to;
30 
31 param[4].Value = base.userName;
32 
33 param[5].Direction = ParameterDirection.Output;//返回的值
34 
35 using (EFContext context = new EFContext())
36 
37 {
38 
39 var results =
40 
41 context.Database.ExecuteSqlCommand(
42 
43 "fm_init_opening_balance @p_org_info_id,@p_customer_info_id ,@p_account_month_from,@p_account_month_to,@p_user_name,@p_feedback output",
44 
45 param[0], param[1], param[2], param[3], param[4], param[5]);
46 
47 context.Dispose();
48 
49 }
50 
51 var msg = param[5].Value;
52 
53 return Json(msg, JsonRequestBehavior.AllowGet);

 

转载于:https://www.cnblogs.com/guess/p/6168801.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值