/// <summary> /// 添加Bug日志 Sys_BugLog对象(即:一条记录) /// </summary> public int Add(Sys_BugLog sys_BugLog) { string sql = "INSERT INTO Sys_BugLog (SL_Code,SL_OpUser,SL_Date,SL_Status,SL_Owner,Stat) VALUES (@SL_Code,@SL_OpUser,@SL_Date,@SL_Status,@SL_Owner,@Stat)"; if (string.IsNullOrEmpty(sys_BugLog.SL_Code)) { idb.AddParameter("@SL_Code", DBNull.Value); } else { idb.AddParameter("@SL_Code", sys_BugLog.SL_Code); } if (string.IsNullOrEmpty(sys_BugLog.SL_OpUser)) { idb.AddParameter("@SL_OpUser", DBNull.Value); } else { idb.AddParameter("@SL_OpUser", sys_BugLog.SL_OpUser); } if (sys_BugLog.SL_Date == DateTime.MinValue) { idb.AddParameter("@SL_Date", DBNull.Value); } else { idb.AddParameter("@SL_Date", sys_BugLog.SL_Date); } if (string.IsNullOrEmpty(sys_BugLog.SL_Status)) { idb.AddParameter("@SL_Status", DBNull.Value); } else { idb.AddParameter("@SL_Status", sys_BugLog.SL_Status); } if (string.IsNullOrEmpty(sys_BugLog.SL_Owner)) { idb.AddParameter("@SL_Owner", DBNull.Value); } else { idb.AddParameter("@SL_Owner", sys_BugLog.SL_Owner); } if (sys_BugLog.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", sys_BugLog.Stat); } int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 更新Bug日志 Sys_BugLog对象(即:一条记录 /// </summary> public int Update(Sys_BugLog sys_BugLog) { StringBuilder sbParameter = new StringBuilder(); StringBuilder sb = new StringBuilder(); sb.Append(@"UPDATE Sys_BugLog SET "); if (sys_BugLog.SL_Code_IsChanged) { sbParameter.Append("SL_Code=@SL_Code, "); } if (sys_BugLog.SL_OpUser_IsChanged) { sbParameter.Append("SL_OpUser=@SL_OpUser, "); } if (sys_BugLog.SL_Date_IsChanged) { sbParameter.Append("SL_Date=@SL_Date, "); } if (sys_BugLog.SL_Status_IsChanged) { sbParameter.Append("SL_Status=@SL_Status, "); } if (sys_BugLog.SL_Owner_IsChanged) { sbParameter.Append("SL_Owner=@SL_Owner, "); } if (sys_BugLog.Stat_IsChanged) { sbParameter.Append("Stat=@Stat "); } sb.Append(sbParameter.ToString().Trim().TrimEnd(',')); sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0)) and SL_ID=@SL_ID; "); string sql = sb.ToString(); if (sys_BugLog.SL_Code_IsChanged) { if (string.IsNullOrEmpty(sys_BugLog.SL_Code)) { idb.AddParameter("@SL_Code", DBNull.Value); } else { idb.AddParameter("@SL_Code", sys_BugLog.SL_Code); } } if (sys_BugLog.SL_OpUser_IsChanged) { if (string.IsNullOrEmpty(sys_BugLog.SL_OpUser)) { idb.AddParameter("@SL_OpUser", DBNull.Value); } else { idb.AddParameter("@SL_OpUser", sys_BugLog.SL_OpUser); } } if (sys_BugLog.SL_Date_IsChanged) { if (sys_BugLog.SL_Date == DateTime.MinValue) { idb.AddParameter("@SL_Date", DBNull.Value); } else { idb.AddParameter("@SL_Date", sys_BugLog.SL_Date); } } if (sys_BugLog.SL_Status_IsChanged) { if (string.IsNullOrEmpty(sys_BugLog.SL_Status)) { idb.AddParameter("@SL_Status", DBNull.Value); } else { idb.AddParameter("@SL_Status", sys_BugLog.SL_Status); } } if (sys_BugLog.SL_Owner_IsChanged) { if (string.IsNullOrEmpty(sys_BugLog.SL_Owner)) { idb.AddParameter("@SL_Owner", DBNull.Value); } else { idb.AddParameter("@SL_Owner", sys_BugLog.SL_Owner); } } if (sys_BugLog.Stat_IsChanged) { if (sys_BugLog.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", sys_BugLog.Stat); } } idb.AddParameter("@SL_ID", sys_BugLog.SL_ID); int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 添加Sys_LoginLog Sys_LoginLog对象(即:一条记录) /// </summary> public int Add(Sys_LoginLog sys_LoginLog) { string sql = "INSERT INTO Sys_LoginLog (EL_Date,EL_IP,EL_Mac,EL_Success,EL_UserCode,EL_UserName,EL_Dept,EL_Company,EL_CancleDate,Stat) VALUES (@EL_Date,@EL_IP,@EL_Mac,@EL_Success,@EL_UserCode,@EL_UserName,@EL_Dept,@EL_Company,@EL_CancleDate,@Stat)"; if (sys_LoginLog.EL_Date == DateTime.MinValue) { idb.AddParameter("@EL_Date", DBNull.Value); } else { idb.AddParameter("@EL_Date", sys_LoginLog.EL_Date); } if (string.IsNullOrEmpty(sys_LoginLog.EL_IP)) { idb.AddParameter("@EL_IP", DBNull.Value); } else { idb.AddParameter("@EL_IP", sys_LoginLog.EL_IP); } if (string.IsNullOrEmpty(sys_LoginLog.EL_Mac)) { idb.AddParameter("@EL_Mac", DBNull.Value); } else { idb.AddParameter("@EL_Mac", sys_LoginLog.EL_Mac); } if (string.IsNullOrEmpty(sys_LoginLog.EL_Success)) { idb.AddParameter("@EL_Success", DBNull.Value); } else { idb.AddParameter("@EL_Success", sys_LoginLog.EL_Success); } if (string.IsNullOrEmpty(sys_LoginLog.EL_UserCode)) { idb.AddParameter("@EL_UserCode", DBNull.Value); } else { idb.AddParameter("@EL_UserCode", sys_LoginLog.EL_UserCode); } if (string.IsNullOrEmpty(sys_LoginLog.EL_UserName)) { idb.AddParameter("@EL_UserName", DBNull.Value); } else { idb.AddParameter("@EL_UserName", sys_LoginLog.EL_UserName); } if (string.IsNullOrEmpty(sys_LoginLog.EL_Dept)) { idb.AddParameter("@EL_Dept", DBNull.Value); } else { idb.AddParameter("@EL_Dept", sys_LoginLog.EL_Dept); } if (string.IsNullOrEmpty(sys_LoginLog.EL_Company)) { idb.AddParameter("@EL_Company", DBNull.Value); } else { idb.AddParameter("@EL_Company", sys_LoginLog.EL_Company); } if (sys_LoginLog.EL_CancleDate == DateTime.MinValue) { idb.AddParameter("@EL_CancleDate", DBNull.Value); } else { idb.AddParameter("@EL_CancleDate", sys_LoginLog.EL_CancleDate); } if (sys_LoginLog.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", sys_LoginLog.Stat); } int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name,Ex); return Re; }
/// <summary> /// 更新数据字典 Bse_Dict对象(即:一条记录 /// </summary> public int Update(Bse_Dict bse_Dict) { StringBuilder sbParameter = new StringBuilder(); StringBuilder sb = new StringBuilder(); sb.Append(@"UPDATE Bse_Dict SET "); if (bse_Dict.Dict_Key_IsChanged) { sbParameter.Append("Dict_Key=@Dict_Key, "); } if (bse_Dict.Dict_Code_IsChanged) { sbParameter.Append("Dict_Code=@Dict_Code, "); } if (bse_Dict.Dict_Name_IsChanged) { sbParameter.Append("Dict_Name=@Dict_Name, "); } if (bse_Dict.Dict_Order_IsChanged) { sbParameter.Append("Dict_Order=@Dict_Order, "); } if (bse_Dict.Dict_PCode_IsChanged) { sbParameter.Append("Dict_PCode=@Dict_PCode, "); } if (bse_Dict.Dict_PName_IsChanged) { sbParameter.Append("Dict_PName=@Dict_PName, "); } if (bse_Dict.Dict_Desp_IsChanged) { sbParameter.Append("Dict_Desp=@Dict_Desp, "); } if (bse_Dict.Dict_SCode_IsChanged) { sbParameter.Append("Dict_SCode=@Dict_SCode, "); } if (bse_Dict.Dict_Bak_IsChanged) { sbParameter.Append("Dict_Bak=@Dict_Bak, "); } if (bse_Dict.Dict_UDef1_IsChanged) { sbParameter.Append("Dict_UDef1=@Dict_UDef1, "); } if (bse_Dict.Dict_UDef2_IsChanged) { sbParameter.Append("Dict_UDef2=@Dict_UDef2, "); } if (bse_Dict.Dict_UDef3_IsChanged) { sbParameter.Append("Dict_UDef3=@Dict_UDef3, "); } if (bse_Dict.Dict_UDef4_IsChanged) { sbParameter.Append("Dict_UDef4=@Dict_UDef4, "); } if (bse_Dict.Dict_UDef5_IsChanged) { sbParameter.Append("Dict_UDef5=@Dict_UDef5, "); } if (bse_Dict.Dict_Level_IsChanged) { sbParameter.Append("Dict_Level=@Dict_Level, "); } if (bse_Dict.Dict_IsEditable_IsChanged) { sbParameter.Append("Dict_IsEditable=@Dict_IsEditable, "); } if (bse_Dict.Stat_IsChanged) { sbParameter.Append("Stat=@Stat "); } sb.Append(sbParameter.ToString().Trim().TrimEnd(',')); sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0)) and Dict_ID=@Dict_ID; "); string sql = sb.ToString(); if (bse_Dict.Dict_Key_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_Key)) { idb.AddParameter("@Dict_Key", DBNull.Value); } else { idb.AddParameter("@Dict_Key", bse_Dict.Dict_Key); } } if (bse_Dict.Dict_Code_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_Code)) { idb.AddParameter("@Dict_Code", DBNull.Value); } else { idb.AddParameter("@Dict_Code", bse_Dict.Dict_Code); } } if (bse_Dict.Dict_Name_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_Name)) { idb.AddParameter("@Dict_Name", DBNull.Value); } else { idb.AddParameter("@Dict_Name", bse_Dict.Dict_Name); } } if (bse_Dict.Dict_Order_IsChanged) { if (bse_Dict.Dict_Order == 0) { idb.AddParameter("@Dict_Order", 0); } else { idb.AddParameter("@Dict_Order", bse_Dict.Dict_Order); } } if (bse_Dict.Dict_PCode_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_PCode)) { idb.AddParameter("@Dict_PCode", DBNull.Value); } else { idb.AddParameter("@Dict_PCode", bse_Dict.Dict_PCode); } } if (bse_Dict.Dict_PName_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_PName)) { idb.AddParameter("@Dict_PName", DBNull.Value); } else { idb.AddParameter("@Dict_PName", bse_Dict.Dict_PName); } } if (bse_Dict.Dict_Desp_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_Desp)) { idb.AddParameter("@Dict_Desp", DBNull.Value); } else { idb.AddParameter("@Dict_Desp", bse_Dict.Dict_Desp); } } if (bse_Dict.Dict_SCode_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_SCode)) { idb.AddParameter("@Dict_SCode", DBNull.Value); } else { idb.AddParameter("@Dict_SCode", bse_Dict.Dict_SCode); } } if (bse_Dict.Dict_Bak_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_Bak)) { idb.AddParameter("@Dict_Bak", DBNull.Value); } else { idb.AddParameter("@Dict_Bak", bse_Dict.Dict_Bak); } } if (bse_Dict.Dict_UDef1_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_UDef1)) { idb.AddParameter("@Dict_UDef1", DBNull.Value); } else { idb.AddParameter("@Dict_UDef1", bse_Dict.Dict_UDef1); } } if (bse_Dict.Dict_UDef2_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_UDef2)) { idb.AddParameter("@Dict_UDef2", DBNull.Value); } else { idb.AddParameter("@Dict_UDef2", bse_Dict.Dict_UDef2); } } if (bse_Dict.Dict_UDef3_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_UDef3)) { idb.AddParameter("@Dict_UDef3", DBNull.Value); } else { idb.AddParameter("@Dict_UDef3", bse_Dict.Dict_UDef3); } } if (bse_Dict.Dict_UDef4_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_UDef4)) { idb.AddParameter("@Dict_UDef4", DBNull.Value); } else { idb.AddParameter("@Dict_UDef4", bse_Dict.Dict_UDef4); } } if (bse_Dict.Dict_UDef5_IsChanged) { if (string.IsNullOrEmpty(bse_Dict.Dict_UDef5)) { idb.AddParameter("@Dict_UDef5", DBNull.Value); } else { idb.AddParameter("@Dict_UDef5", bse_Dict.Dict_UDef5); } } if (bse_Dict.Dict_Level_IsChanged) { if (bse_Dict.Dict_Level == 0) { idb.AddParameter("@Dict_Level", 0); } else { idb.AddParameter("@Dict_Level", bse_Dict.Dict_Level); } } if (bse_Dict.Dict_IsEditable_IsChanged) { if (bse_Dict.Dict_IsEditable == 0) { idb.AddParameter("@Dict_IsEditable", 0); } else { idb.AddParameter("@Dict_IsEditable", bse_Dict.Dict_IsEditable); } } if (bse_Dict.Stat_IsChanged) { if (bse_Dict.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", bse_Dict.Stat); } } idb.AddParameter("@Dict_ID", bse_Dict.Dict_ID); int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 添加数据字典 Bse_Dict对象(即:一条记录) /// </summary> public int Add(Bse_Dict bse_Dict) { string sql = "INSERT INTO Bse_Dict (Dict_Key,Dict_Code,Dict_Name,Dict_Order,Dict_PCode,Dict_PName,Dict_Desp,Dict_SCode,Dict_Bak,Dict_UDef1,Dict_UDef2,Dict_UDef3,Dict_UDef4,Dict_UDef5,Dict_Level,Dict_IsEditable,Stat) VALUES (@Dict_Key,@Dict_Code,@Dict_Name,@Dict_Order,@Dict_PCode,@Dict_PName,@Dict_Desp,@Dict_SCode,@Dict_Bak,@Dict_UDef1,@Dict_UDef2,@Dict_UDef3,@Dict_UDef4,@Dict_UDef5,@Dict_Level,@Dict_IsEditable,@Stat)"; if (string.IsNullOrEmpty(bse_Dict.Dict_Key)) { idb.AddParameter("@Dict_Key", DBNull.Value); } else { idb.AddParameter("@Dict_Key", bse_Dict.Dict_Key); } if (string.IsNullOrEmpty(bse_Dict.Dict_Code)) { idb.AddParameter("@Dict_Code", DBNull.Value); } else { idb.AddParameter("@Dict_Code", bse_Dict.Dict_Code); } if (string.IsNullOrEmpty(bse_Dict.Dict_Name)) { idb.AddParameter("@Dict_Name", DBNull.Value); } else { idb.AddParameter("@Dict_Name", bse_Dict.Dict_Name); } if (bse_Dict.Dict_Order == 0) { idb.AddParameter("@Dict_Order", 0); } else { idb.AddParameter("@Dict_Order", bse_Dict.Dict_Order); } if (string.IsNullOrEmpty(bse_Dict.Dict_PCode)) { idb.AddParameter("@Dict_PCode", DBNull.Value); } else { idb.AddParameter("@Dict_PCode", bse_Dict.Dict_PCode); } if (string.IsNullOrEmpty(bse_Dict.Dict_PName)) { idb.AddParameter("@Dict_PName", DBNull.Value); } else { idb.AddParameter("@Dict_PName", bse_Dict.Dict_PName); } if (string.IsNullOrEmpty(bse_Dict.Dict_Desp)) { idb.AddParameter("@Dict_Desp", DBNull.Value); } else { idb.AddParameter("@Dict_Desp", bse_Dict.Dict_Desp); } if (string.IsNullOrEmpty(bse_Dict.Dict_SCode)) { idb.AddParameter("@Dict_SCode", DBNull.Value); } else { idb.AddParameter("@Dict_SCode", bse_Dict.Dict_SCode); } if (string.IsNullOrEmpty(bse_Dict.Dict_Bak)) { idb.AddParameter("@Dict_Bak", DBNull.Value); } else { idb.AddParameter("@Dict_Bak", bse_Dict.Dict_Bak); } if (string.IsNullOrEmpty(bse_Dict.Dict_UDef1)) { idb.AddParameter("@Dict_UDef1", DBNull.Value); } else { idb.AddParameter("@Dict_UDef1", bse_Dict.Dict_UDef1); } if (string.IsNullOrEmpty(bse_Dict.Dict_UDef2)) { idb.AddParameter("@Dict_UDef2", DBNull.Value); } else { idb.AddParameter("@Dict_UDef2", bse_Dict.Dict_UDef2); } if (string.IsNullOrEmpty(bse_Dict.Dict_UDef3)) { idb.AddParameter("@Dict_UDef3", DBNull.Value); } else { idb.AddParameter("@Dict_UDef3", bse_Dict.Dict_UDef3); } if (string.IsNullOrEmpty(bse_Dict.Dict_UDef4)) { idb.AddParameter("@Dict_UDef4", DBNull.Value); } else { idb.AddParameter("@Dict_UDef4", bse_Dict.Dict_UDef4); } if (string.IsNullOrEmpty(bse_Dict.Dict_UDef5)) { idb.AddParameter("@Dict_UDef5", DBNull.Value); } else { idb.AddParameter("@Dict_UDef5", bse_Dict.Dict_UDef5); } if (bse_Dict.Dict_Level == 0) { idb.AddParameter("@Dict_Level", 0); } else { idb.AddParameter("@Dict_Level", bse_Dict.Dict_Level); } if (bse_Dict.Dict_IsEditable == 0) { idb.AddParameter("@Dict_IsEditable", 0); } else { idb.AddParameter("@Dict_IsEditable", bse_Dict.Dict_IsEditable); } if (bse_Dict.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", bse_Dict.Stat); } int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 添加Bug管理系统 Sys_Bug对象(即:一条记录) /// </summary> public object AddWithReturn(Sys_Bug sys_Bug) { string sql = "INSERT INTO Sys_Bug (Sys_Code,Sys_Date,Sys_Title,Sys_Des,Sys_Project,Sys_Module,Sys_UserCode,Sys_UserName,Sys_Owner,Sys_OpUser,Sys_Status,Stat) VALUES (@Sys_Code,@Sys_Date,@Sys_Title,@Sys_Des,@Sys_Project,@Sys_Module,@Sys_UserCode,@Sys_UserName,@Sys_Owner,@Sys_OpUser,@Sys_Status,@Stat);SELECT @@IDENTITY AS ReturnID;"; if (string.IsNullOrEmpty(sys_Bug.Sys_Code)) { idb.AddParameter("@Sys_Code", DBNull.Value); } else { idb.AddParameter("@Sys_Code", sys_Bug.Sys_Code); } if (sys_Bug.Sys_Date == DateTime.MinValue) { idb.AddParameter("@Sys_Date", DBNull.Value); } else { idb.AddParameter("@Sys_Date", sys_Bug.Sys_Date); } if (string.IsNullOrEmpty(sys_Bug.Sys_Title)) { idb.AddParameter("@Sys_Title", DBNull.Value); } else { idb.AddParameter("@Sys_Title", sys_Bug.Sys_Title); } if (string.IsNullOrEmpty(sys_Bug.Sys_Des)) { idb.AddParameter("@Sys_Des", DBNull.Value); } else { idb.AddParameter("@Sys_Des", sys_Bug.Sys_Des); } if (string.IsNullOrEmpty(sys_Bug.Sys_Project)) { idb.AddParameter("@Sys_Project", DBNull.Value); } else { idb.AddParameter("@Sys_Project", sys_Bug.Sys_Project); } if (string.IsNullOrEmpty(sys_Bug.Sys_Module)) { idb.AddParameter("@Sys_Module", DBNull.Value); } else { idb.AddParameter("@Sys_Module", sys_Bug.Sys_Module); } if (string.IsNullOrEmpty(sys_Bug.Sys_UserCode)) { idb.AddParameter("@Sys_UserCode", DBNull.Value); } else { idb.AddParameter("@Sys_UserCode", sys_Bug.Sys_UserCode); } if (string.IsNullOrEmpty(sys_Bug.Sys_UserName)) { idb.AddParameter("@Sys_UserName", DBNull.Value); } else { idb.AddParameter("@Sys_UserName", sys_Bug.Sys_UserName); } if (string.IsNullOrEmpty(sys_Bug.Sys_Owner)) { idb.AddParameter("@Sys_Owner", DBNull.Value); } else { idb.AddParameter("@Sys_Owner", sys_Bug.Sys_Owner); } if (string.IsNullOrEmpty(sys_Bug.Sys_OpUser)) { idb.AddParameter("@Sys_OpUser", DBNull.Value); } else { idb.AddParameter("@Sys_OpUser", sys_Bug.Sys_OpUser); } if (string.IsNullOrEmpty(sys_Bug.Sys_Status)) { idb.AddParameter("@Sys_Status", DBNull.Value); } else { idb.AddParameter("@Sys_Status", sys_Bug.Sys_Status); } if (sys_Bug.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", sys_Bug.Stat); } int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { var Return = idb.ReturnValue(sql); Ex = Return.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }