zoukankan      html  css  js  c++  java
  • 后台调用存储过程

     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);
  • 相关阅读:
    namespace
    kubernetes环境搭建
    verdaccio私有仓库搭建
    mysql中间件proxysql
    MySQL存储引擎
    关于分布式系统
    转载:ETL讲解
    用原生JS 写Web首页轮播图
    javascript——记忆小便签
    转载:JavaScript 的 this 原理
  • 原文地址:https://www.cnblogs.com/guess/p/6168801.html
Copyright © 2011-2022 走看看