Example #1
0
        public IRAPJsonResult msp_InsertIntoDBF_MO(
            List <dpa_DBF_MO> datas,
            out int errCode,
            out string errText)
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            Hashtable rlt = new Hashtable();

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                using (IRAPSQLConnection conn = new IRAPSQLConnection())
                {
                    try
                    {
                        int count = conn.BatchInsert(datas);

                        errCode = 0;
                        errText =
                            string.Format(
                                "在 IRAPDPA..dpa_DBF_MO 表中插入 [{0}] 条记录",
                                count);
                    }
                    catch (Exception error)
                    {
                        errCode = 99000;
                        errText =
                            string.Format(
                                "在向 IRAPDPA..dpa_DBF_MO 表中插入记录时发生异常:{0}",
                                error.Message);
                        WriteLog.Instance.Write(errText, strProcedureName);
                        WriteLog.Instance.Write(error.StackTrace, strProcedureName);
                    }
                }

                return(Json(rlt));
            }
            catch (Exception error)
            {
                errCode = 99000;
                errText =
                    string.Format(
                        "在向 IRAPDPA..dpa_DBF_MO 表中插入记录时发生异常:{0}",
                        error.Message);
                WriteLog.Instance.Write(errText, strProcedureName);
                WriteLog.Instance.Write(error.StackTrace, strProcedureName);

                return(Json(rlt));
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }