ef mysql 存储过程_Entity Framework访问MySQL数据库的存储过程并获取返回值

publicActionResult EditWorkOrder(FormCollection collection)

{

AppLog.Info("EditWorkOrder");try{string openID = Session["OpenID"].ToString();

AppLog.Info("添加派工单时的openid:" +openID );int personindex =DBAccess.Bussiness.GetStaffIndex(openID);int businessindex =Convert.ToInt32(Session["PROVIDERINDEX_BUSINESSINDEX"].ToString().Split('/')[1]);//道路...index

int systemstatus = 0;int providerindex = Convert.ToInt32(collection["ProviderList"]);//维护单位

string alarmindex = Session["Alarmindex"].ToString();//报警编号有上文提供

int orderlevel = Convert.ToInt32(collection["WorkOrderLevel"]);//优先级别

int fixperson = Convert.ToInt32(collection["RepairUserList"]);//维修人员

string currentstatus = Convert.ToString(collection["WorkOrderStatusList"]);//新增

string orderhandle =string.Empty;if(collection["OrderHandle"]!=null)

{

orderhandle= collection["OrderHandle"];//故障分类处理描述

}string handletype = Convert.ToString(collection["AlarmHandleTypeList"]);//故障处理分类

AppLog.Info("派工单参数信息:" + "--personindex:"+personindex+ "--businessindex:"+businessindex+ "--providerindex:"+providerindex+ "--alarmindex:"+alarmindex+ "--orderlevel:"+orderlevel+ "--fixperson:"+fixperson+ "--currentstatus:"+currentstatus+"--orderhandle:"+orderhandle+"--handletype:"+handletype);

MySqlParameter[] prams= new MySqlParameter[11];

prams[0] = new MySqlParameter("@personindex", personindex);

prams[1] = new MySqlParameter("@businessindex", businessindex);

prams[2] = new MySqlParameter("@systemstatus", systemstatus);

prams[3] = new MySqlParameter("@providerindex", providerindex);

prams[4] = new MySqlParameter("@alarmindex", alarmindex);

prams[5] = new MySqlParameter("@orderlevel", orderlevel);

prams[6] = new MySqlParameter("@exceptfixtime", 24);

prams[7] = new MySqlParameter("@fixperson", fixperson);

prams[8] = new MySqlParameter("@currentstatus", currentstatus);

prams[9] = new MySqlParameter("@orderhandle", orderhandle);

prams[10] = new MySqlParameter("@handletype", handletype);using (cnpsim_dbEntities dbManager = newcnpsim_dbEntities())

{var index = dbManager.Database.SqlQuery("call InsertWorkOrderInfo(@personindex,@businessindex,@systemstatus,@providerindex ,@alarmindex, @orderlevel,@exceptfixtime, @fixperson,@currentstatus ,@orderhandle,@handletype)", prams);string ss=index.FirstOrDefault().ToString();string s =ss;return RedirectToAction("SuccessInfo", "BackInfo", new { str1 = "成功添加派工单", str2 = "", url = "http://wx115.cnpsim.com/Business/index"});

}

}catch(Exception ex)

{return null;

}

}

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值