示例#1
0
        /// <summary>
        /// 获取某个表某个字段最大值
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="col"></param>
        /// <returns></returns>
        public object GetMax(string tableName, string col)
        {
            string sql = string.Format(@"SELECT
	isnull(Max({0}),0)
FROM
	{1} WHERE 1=1"    , col, tableName);

            return(idb.ReturnValue(sql));
        }
示例#2
0
        /// <summary>
        /// 添加系统运行日志 Sys_RunLog对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Sys_RunLog sys_RunLog)
        {
            string sql = "INSERT INTO Sys_RunLog (Log_Date,Log_SQL,Log_Author,Log_Fun,Log_SQLParameter,Log_Error) VALUES (@Log_Date,@Log_SQL,@Log_Author,@Log_Fun,@Log_SQLParameter,@Log_Error);SELECT @@IDENTITY AS ReturnID;";

            if (sys_RunLog.Log_Date == DateTime.MinValue)
            {
                idb.AddParameter("@Log_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_Date", sys_RunLog.Log_Date);
            }
            if (string.IsNullOrEmpty(sys_RunLog.Log_SQL))
            {
                idb.AddParameter("@Log_SQL", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_SQL", sys_RunLog.Log_SQL);
            }
            if (string.IsNullOrEmpty(sys_RunLog.Log_Author))
            {
                idb.AddParameter("@Log_Author", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_Author", sys_RunLog.Log_Author);
            }
            if (string.IsNullOrEmpty(sys_RunLog.Log_Fun))
            {
                idb.AddParameter("@Log_Fun", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_Fun", sys_RunLog.Log_Fun);
            }
            if (string.IsNullOrEmpty(sys_RunLog.Log_SQLParameter))
            {
                idb.AddParameter("@Log_SQLParameter", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_SQLParameter", sys_RunLog.Log_SQLParameter);
            }
            if (string.IsNullOrEmpty(sys_RunLog.Log_Error))
            {
                idb.AddParameter("@Log_Error", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Log_Error", sys_RunLog.Log_Error);
            }

            return(idb.ReturnValue(sql));
        }
示例#3
0
        /// <summary>
        /// 添加系统消息处理日志 Sys_AnnoceLog对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Sys_AnnoceLog sys_AnnoceLog)
        {
            string sql = "INSERT INTO Sys_AnnoceLog (EL_UserCode,EL_Date,EL_IP) VALUES (@EL_UserCode,@EL_Date,@EL_IP);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(sys_AnnoceLog.EL_UserCode))
            {
                idb.AddParameter("@EL_UserCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EL_UserCode", sys_AnnoceLog.EL_UserCode);
            }
            if (sys_AnnoceLog.EL_Date == DateTime.MinValue)
            {
                idb.AddParameter("@EL_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EL_Date", sys_AnnoceLog.EL_Date);
            }
            if (string.IsNullOrEmpty(sys_AnnoceLog.EL_IP))
            {
                idb.AddParameter("@EL_IP", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EL_IP", sys_AnnoceLog.EL_IP);
            }


            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);
        }
示例#4
0
        /// <summary>
        /// 添加顶部快捷方式 System_TopMenu对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(System_TopMenu system_TopMenu)
        {
            string sql = "INSERT INTO System_TopMenu (Menu_User,Menu_Links) VALUES (@Menu_User,@Menu_Links);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(system_TopMenu.Menu_User))
            {
                idb.AddParameter("@Menu_User", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_User", system_TopMenu.Menu_User);
            }
            if (string.IsNullOrEmpty(system_TopMenu.Menu_Links))
            {
                idb.AddParameter("@Menu_Links", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Links", system_TopMenu.Menu_Links);
            }


            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);
        }
示例#5
0
        /// <summary>
        /// 添加付款条款 Pay_Clause对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Pay_Clause pay_Clause)
        {
            string sql = "INSERT INTO Pay_Clause (Contract_Code,Stat) VALUES (@Contract_Code,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pay_Clause.Contract_Code))
            {
                idb.AddParameter("@Contract_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Contract_Code", pay_Clause.Contract_Code);
            }
            if (pay_Clause.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pay_Clause.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);
        }
示例#6
0
        /// <summary>
        /// 添加审核模板配置表 Verify_TemplateConfig对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Verify_TemplateConfig verify_TemplateConfig)
        {
            string sql = "INSERT INTO Verify_TemplateConfig (VT_Template_Code,VT_Key,VT_VerifyNode_Code,VT_VerifyNode_Name,Flag,VT_VerifyNode_Order,VT_VerifyNode_Back,VT_VerifyNode_BackName,VT_Remark,Stat,VT_AcSum,VT_AcNodeName,VT_AcNodeCode) VALUES (@VT_Template_Code,@VT_Key,@VT_VerifyNode_Code,@VT_VerifyNode_Name,@Flag,@VT_VerifyNode_Order,@VT_VerifyNode_Back,@VT_VerifyNode_BackName,@VT_Remark,@Stat,@VT_AcSum,@VT_AcNodeName,@VT_AcNodeCode);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Template_Code))
            {
                idb.AddParameter("@VT_Template_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Template_Code", verify_TemplateConfig.VT_Template_Code);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Key))
            {
                idb.AddParameter("@VT_Key", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Key", verify_TemplateConfig.VT_Key);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Code))
            {
                idb.AddParameter("@VT_VerifyNode_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Code", verify_TemplateConfig.VT_VerifyNode_Code);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Name))
            {
                idb.AddParameter("@VT_VerifyNode_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Name", verify_TemplateConfig.VT_VerifyNode_Name);
            }
            if (verify_TemplateConfig.Flag == 0)
            {
                idb.AddParameter("@Flag", 0);
            }
            else
            {
                idb.AddParameter("@Flag", verify_TemplateConfig.Flag);
            }
            if (verify_TemplateConfig.VT_VerifyNode_Order == 0)
            {
                idb.AddParameter("@VT_VerifyNode_Order", 0);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Order", verify_TemplateConfig.VT_VerifyNode_Order);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Back))
            {
                idb.AddParameter("@VT_VerifyNode_Back", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Back", verify_TemplateConfig.VT_VerifyNode_Back);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_BackName))
            {
                idb.AddParameter("@VT_VerifyNode_BackName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_BackName", verify_TemplateConfig.VT_VerifyNode_BackName);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Remark))
            {
                idb.AddParameter("@VT_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Remark", verify_TemplateConfig.VT_Remark);
            }
            if (verify_TemplateConfig.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", verify_TemplateConfig.Stat);
            }
            if (verify_TemplateConfig.VT_AcSum == 0)
            {
                idb.AddParameter("@VT_AcSum", 0);
            }
            else
            {
                idb.AddParameter("@VT_AcSum", verify_TemplateConfig.VT_AcSum);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_AcNodeName))
            {
                idb.AddParameter("@VT_AcNodeName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_AcNodeName", verify_TemplateConfig.VT_AcNodeName);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_AcNodeCode))
            {
                idb.AddParameter("@VT_AcNodeCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_AcNodeCode", verify_TemplateConfig.VT_AcNodeCode);
            }


            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);
        }
示例#7
0
        /// <summary>
        /// 添加联系人信息 Bse_Contacts对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Bse_Contacts bse_Contacts)
        {
            string sql = "INSERT INTO Bse_Contacts (Module_Code,Record_ID,BContact_Name,BContact_Tel1,BContact_Tel2,BContact_Fax,BContact_Addr,BContact_Email,BContact_Duty,BContact_Gender,BContact_Career,BContact_Birth,BContact_From,BContact_IsDefault,CreateDate,Creator,BContact_Bak1,BContact_Bak2,Stat,BContact_Code,UpdateDate,DeleteDate) VALUES (@Module_Code,@Record_ID,@BContact_Name,@BContact_Tel1,@BContact_Tel2,@BContact_Fax,@BContact_Addr,@BContact_Email,@BContact_Duty,@BContact_Gender,@BContact_Career,@BContact_Birth,@BContact_From,@BContact_IsDefault,@CreateDate,@Creator,@BContact_Bak1,@BContact_Bak2,@Stat,@BContact_Code,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(bse_Contacts.Module_Code))
            {
                idb.AddParameter("@Module_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Module_Code", bse_Contacts.Module_Code);
            }
            if (string.IsNullOrEmpty(bse_Contacts.Record_ID))
            {
                idb.AddParameter("@Record_ID", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Record_ID", bse_Contacts.Record_ID);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Name))
            {
                idb.AddParameter("@BContact_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Name", bse_Contacts.BContact_Name);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel1))
            {
                idb.AddParameter("@BContact_Tel1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Tel1", bse_Contacts.BContact_Tel1);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel2))
            {
                idb.AddParameter("@BContact_Tel2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Tel2", bse_Contacts.BContact_Tel2);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Fax))
            {
                idb.AddParameter("@BContact_Fax", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Fax", bse_Contacts.BContact_Fax);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Addr))
            {
                idb.AddParameter("@BContact_Addr", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Addr", bse_Contacts.BContact_Addr);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Email))
            {
                idb.AddParameter("@BContact_Email", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Email", bse_Contacts.BContact_Email);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Duty))
            {
                idb.AddParameter("@BContact_Duty", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Duty", bse_Contacts.BContact_Duty);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Gender))
            {
                idb.AddParameter("@BContact_Gender", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Gender", bse_Contacts.BContact_Gender);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Career))
            {
                idb.AddParameter("@BContact_Career", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Career", bse_Contacts.BContact_Career);
            }
            if (bse_Contacts.BContact_Birth == DateTime.MinValue)
            {
                idb.AddParameter("@BContact_Birth", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Birth", bse_Contacts.BContact_Birth);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_From))
            {
                idb.AddParameter("@BContact_From", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_From", bse_Contacts.BContact_From);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_IsDefault))
            {
                idb.AddParameter("@BContact_IsDefault", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_IsDefault", bse_Contacts.BContact_IsDefault);
            }
            if (bse_Contacts.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", bse_Contacts.CreateDate);
            }
            if (string.IsNullOrEmpty(bse_Contacts.Creator))
            {
                idb.AddParameter("@Creator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Creator", bse_Contacts.Creator);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak1))
            {
                idb.AddParameter("@BContact_Bak1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Bak1", bse_Contacts.BContact_Bak1);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak2))
            {
                idb.AddParameter("@BContact_Bak2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Bak2", bse_Contacts.BContact_Bak2);
            }
            if (bse_Contacts.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", bse_Contacts.Stat);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Code))
            {
                idb.AddParameter("@BContact_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Code", bse_Contacts.BContact_Code);
            }
            if (bse_Contacts.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", bse_Contacts.UpdateDate);
            }
            if (bse_Contacts.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", bse_Contacts.DeleteDate);
            }


            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);
        }
示例#8
0
        /// <summary>
        /// 添加车辆事件表 PCT_Event对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(PCT_Event pCT_Event)
        {
            string sql = "INSERT INTO PCT_Event (PCTE_Code,PCTE_CCode,PCTE_CNo,PCTE_Description,PCTE_BeginDate,PCTE_EndDate,PCTE_EventType,PCTE_DCode,PCTE_Join,PCTE_Cost,PCTE_Before,PCTE_After,PCTE_Address,Stat,CreateDate,UpdateDate,DeleteDate,PCTE_iType,PCTE_TCode,PCTE_Udef2,PCTE_Udef3,PCTE_Udef4,PCTE_Udef5) VALUES (@PCTE_Code,@PCTE_CCode,@PCTE_CNo,@PCTE_Description,@PCTE_BeginDate,@PCTE_EndDate,@PCTE_EventType,@PCTE_DCode,@PCTE_Join,@PCTE_Cost,@PCTE_Before,@PCTE_After,@PCTE_Address,@Stat,@CreateDate,@UpdateDate,@DeleteDate,@PCTE_iType,@PCTE_TCode,@PCTE_Udef2,@PCTE_Udef3,@PCTE_Udef4,@PCTE_Udef5);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pCT_Event.PCTE_Code))
            {
                idb.AddParameter("@PCTE_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Code", pCT_Event.PCTE_Code);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_CCode))
            {
                idb.AddParameter("@PCTE_CCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_CCode", pCT_Event.PCTE_CCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_CNo))
            {
                idb.AddParameter("@PCTE_CNo", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_CNo", pCT_Event.PCTE_CNo);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Description))
            {
                idb.AddParameter("@PCTE_Description", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Description", pCT_Event.PCTE_Description);
            }
            if (pCT_Event.PCTE_BeginDate == DateTime.MinValue)
            {
                idb.AddParameter("@PCTE_BeginDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_BeginDate", pCT_Event.PCTE_BeginDate);
            }
            if (pCT_Event.PCTE_EndDate == DateTime.MinValue)
            {
                idb.AddParameter("@PCTE_EndDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_EndDate", pCT_Event.PCTE_EndDate);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_EventType))
            {
                idb.AddParameter("@PCTE_EventType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_EventType", pCT_Event.PCTE_EventType);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_DCode))
            {
                idb.AddParameter("@PCTE_DCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_DCode", pCT_Event.PCTE_DCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Join))
            {
                idb.AddParameter("@PCTE_Join", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Join", pCT_Event.PCTE_Join);
            }
            if (pCT_Event.PCTE_Cost == 0)
            {
                idb.AddParameter("@PCTE_Cost", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_Cost", pCT_Event.PCTE_Cost);
            }
            if (pCT_Event.PCTE_Before == 0)
            {
                idb.AddParameter("@PCTE_Before", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_Before", pCT_Event.PCTE_Before);
            }
            if (pCT_Event.PCTE_After == 0)
            {
                idb.AddParameter("@PCTE_After", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_After", pCT_Event.PCTE_After);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Address))
            {
                idb.AddParameter("@PCTE_Address", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Address", pCT_Event.PCTE_Address);
            }
            if (pCT_Event.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pCT_Event.Stat);
            }
            if (pCT_Event.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", pCT_Event.CreateDate);
            }
            if (pCT_Event.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", pCT_Event.UpdateDate);
            }
            if (pCT_Event.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", pCT_Event.DeleteDate);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_iType))
            {
                idb.AddParameter("@PCTE_iType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_iType", pCT_Event.PCTE_iType);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_TCode))
            {
                idb.AddParameter("@PCTE_TCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_TCode", pCT_Event.PCTE_TCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef2))
            {
                idb.AddParameter("@PCTE_Udef2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef2", pCT_Event.PCTE_Udef2);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef3))
            {
                idb.AddParameter("@PCTE_Udef3", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef3", pCT_Event.PCTE_Udef3);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef4))
            {
                idb.AddParameter("@PCTE_Udef4", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef4", pCT_Event.PCTE_Udef4);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef5))
            {
                idb.AddParameter("@PCTE_Udef5", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef5", pCT_Event.PCTE_Udef5);
            }


            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);
        }
示例#9
0
        /// <summary>
        /// 添加Sys_Map对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Sys_Map sys_Map)
        {
            string sql = "INSERT INTO Sys_Map (Map_Module,Map_Source,Map_Object,Map_Object1,Map_Object2,Map_Type,Map_UDEF1,Map_UDEF2,Map_UDEF3,Map_UDEF4,Map_UDEF5,Stat) VALUES (@Map_Module,@Map_Source,@Map_Object,@Map_Object1,@Map_Object2,@Map_Type,@Map_UDEF1,@Map_UDEF2,@Map_UDEF3,@Map_UDEF4,@Map_UDEF5,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(sys_Map.Map_Module))
            {
                idb.AddParameter("@Map_Module", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Module", sys_Map.Map_Module);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_Source))
            {
                idb.AddParameter("@Map_Source", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Source", sys_Map.Map_Source);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_Object))
            {
                idb.AddParameter("@Map_Object", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Object", sys_Map.Map_Object);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_Object1))
            {
                idb.AddParameter("@Map_Object1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Object1", sys_Map.Map_Object1);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_Object2))
            {
                idb.AddParameter("@Map_Object2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Object2", sys_Map.Map_Object2);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_Type))
            {
                idb.AddParameter("@Map_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_Type", sys_Map.Map_Type);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_UDEF1))
            {
                idb.AddParameter("@Map_UDEF1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_UDEF1", sys_Map.Map_UDEF1);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_UDEF2))
            {
                idb.AddParameter("@Map_UDEF2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_UDEF2", sys_Map.Map_UDEF2);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_UDEF3))
            {
                idb.AddParameter("@Map_UDEF3", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_UDEF3", sys_Map.Map_UDEF3);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_UDEF4))
            {
                idb.AddParameter("@Map_UDEF4", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_UDEF4", sys_Map.Map_UDEF4);
            }
            if (string.IsNullOrEmpty(sys_Map.Map_UDEF5))
            {
                idb.AddParameter("@Map_UDEF5", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Map_UDEF5", sys_Map.Map_UDEF5);
            }
            if (sys_Map.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", sys_Map.Stat);
            }

            return(idb.ReturnValue(sql));
        }
示例#10
0
        /// <summary>
        /// 添加审核阶段信息 Verify_Nodes对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Verify_Nodes verify_Nodes)
        {
            string sql = "INSERT INTO Verify_Nodes (VerifyNode_Code,VerifyNode_Name,VerifyNode_Remark,VerifyNode_AuditNum,Stat) VALUES (@VerifyNode_Code,@VerifyNode_Name,@VerifyNode_Remark,@VerifyNode_AuditNum,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Code))
            {
                idb.AddParameter("@VerifyNode_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Code", verify_Nodes.VerifyNode_Code);
            }
            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Name))
            {
                idb.AddParameter("@VerifyNode_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Name", verify_Nodes.VerifyNode_Name);
            }
            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Remark))
            {
                idb.AddParameter("@VerifyNode_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Remark", verify_Nodes.VerifyNode_Remark);
            }
            if (verify_Nodes.VerifyNode_AuditNum == 0)
            {
                idb.AddParameter("@VerifyNode_AuditNum", 0);
            }
            else
            {
                idb.AddParameter("@VerifyNode_AuditNum", verify_Nodes.VerifyNode_AuditNum);
            }
            if (verify_Nodes.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", verify_Nodes.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);
        }
示例#11
0
        /// <summary>
        /// 添加搅拌站信息 PC_BStation对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(PC_BStation pC_BStation)
        {
            string sql = "INSERT INTO PC_BStation (PCBS_Code,PCBS_Name,PCBS_Addr,PCBS_Start,PCBS_Status,PCBS_Bak,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@PCBS_Code,@PCBS_Name,@PCBS_Addr,@PCBS_Start,@PCBS_Status,@PCBS_Bak,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pC_BStation.PCBS_Code))
            {
                idb.AddParameter("@PCBS_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Code", pC_BStation.PCBS_Code);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Name))
            {
                idb.AddParameter("@PCBS_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Name", pC_BStation.PCBS_Name);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Addr))
            {
                idb.AddParameter("@PCBS_Addr", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Addr", pC_BStation.PCBS_Addr);
            }
            if (pC_BStation.PCBS_Start == DateTime.MinValue)
            {
                idb.AddParameter("@PCBS_Start", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Start", pC_BStation.PCBS_Start);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Status))
            {
                idb.AddParameter("@PCBS_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Status", pC_BStation.PCBS_Status);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Bak))
            {
                idb.AddParameter("@PCBS_Bak", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Bak", pC_BStation.PCBS_Bak);
            }
            if (pC_BStation.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pC_BStation.Stat);
            }
            if (pC_BStation.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", pC_BStation.CreateDate);
            }
            if (pC_BStation.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", pC_BStation.UpdateDate);
            }
            if (pC_BStation.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", pC_BStation.DeleteDate);
            }


            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);
        }
示例#12
0
        /// <summary>
        /// 添加数据字典 Bse_Dict对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(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);SELECT @@IDENTITY AS ReturnID;";

            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
            {
                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);
        }
示例#13
0
        /// <summary>
        /// 添加合同细目信息 WH_CItem对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(WH_CItem wH_CItem)
        {
            string sql = "INSERT INTO WH_CItem (WHCI_CCode,WHCI_MCode,WHCI_Num,WHCI_Unit,WHCI_Manu,WHCI_MDate,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@WHCI_CCode,@WHCI_MCode,@WHCI_Num,@WHCI_Unit,@WHCI_Manu,@WHCI_MDate,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(wH_CItem.WHCI_CCode))
            {
                idb.AddParameter("@WHCI_CCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_CCode", wH_CItem.WHCI_CCode);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_MCode))
            {
                idb.AddParameter("@WHCI_MCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_MCode", wH_CItem.WHCI_MCode);
            }
            if (wH_CItem.WHCI_Num == 0)
            {
                idb.AddParameter("@WHCI_Num", 0);
            }
            else
            {
                idb.AddParameter("@WHCI_Num", wH_CItem.WHCI_Num);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_Unit))
            {
                idb.AddParameter("@WHCI_Unit", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_Unit", wH_CItem.WHCI_Unit);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_Manu))
            {
                idb.AddParameter("@WHCI_Manu", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_Manu", wH_CItem.WHCI_Manu);
            }
            if (wH_CItem.WHCI_MDate == DateTime.MinValue)
            {
                idb.AddParameter("@WHCI_MDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_MDate", wH_CItem.WHCI_MDate);
            }
            if (wH_CItem.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", wH_CItem.Stat);
            }
            if (wH_CItem.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", wH_CItem.CreateDate);
            }
            if (wH_CItem.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", wH_CItem.UpdateDate);
            }
            if (wH_CItem.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", wH_CItem.DeleteDate);
            }


            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);
        }
示例#14
0
        /// <summary>
        /// 添加TC_SJComp对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(TC_SJComp tC_SJComp)
        {
            string sql = "INSERT INTO TC_SJComp (TCJ_Code,TCJ_Name,TCJ_PLine,TCJ_Stat,Stat,CreateDate,UpdateDate,DeleteDate,TCJ_Udef1,TCJ_Udef2,TCJ_Udef3,TCJ_Udef4,TCJ_Udef5) VALUES (@TCJ_Code,@TCJ_Name,@TCJ_PLine,@TCJ_Stat,@Stat,@CreateDate,@UpdateDate,@DeleteDate,@TCJ_Udef1,@TCJ_Udef2,@TCJ_Udef3,@TCJ_Udef4,@TCJ_Udef5);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Code))
            {
                idb.AddParameter("@TCJ_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Code", tC_SJComp.TCJ_Code);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Name))
            {
                idb.AddParameter("@TCJ_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Name", tC_SJComp.TCJ_Name);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_PLine))
            {
                idb.AddParameter("@TCJ_PLine", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_PLine", tC_SJComp.TCJ_PLine);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Stat))
            {
                idb.AddParameter("@TCJ_Stat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Stat", tC_SJComp.TCJ_Stat);
            }
            if (tC_SJComp.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", tC_SJComp.Stat);
            }
            if (tC_SJComp.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", tC_SJComp.CreateDate);
            }
            if (tC_SJComp.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", tC_SJComp.UpdateDate);
            }
            if (tC_SJComp.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", tC_SJComp.DeleteDate);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Udef1))
            {
                idb.AddParameter("@TCJ_Udef1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Udef1", tC_SJComp.TCJ_Udef1);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Udef2))
            {
                idb.AddParameter("@TCJ_Udef2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Udef2", tC_SJComp.TCJ_Udef2);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Udef3))
            {
                idb.AddParameter("@TCJ_Udef3", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Udef3", tC_SJComp.TCJ_Udef3);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Udef4))
            {
                idb.AddParameter("@TCJ_Udef4", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Udef4", tC_SJComp.TCJ_Udef4);
            }
            if (string.IsNullOrEmpty(tC_SJComp.TCJ_Udef5))
            {
                idb.AddParameter("@TCJ_Udef5", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TCJ_Udef5", tC_SJComp.TCJ_Udef5);
            }


            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);
        }
示例#15
0
        /// <summary>
        /// 添加考评信息 HR_Evaluation对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(HR_Evaluation hR_Evaluation)
        {
            string sql = "INSERT INTO HR_Evaluation (Eva_Code,Eva_StuffCode,Eva_StuffName,Eva_Date,Eva_Records,Eva_Conclusion,Eva_Manager,Eva_Level,Eva_Bak,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@Eva_Code,@Eva_StuffCode,@Eva_StuffName,@Eva_Date,@Eva_Records,@Eva_Conclusion,@Eva_Manager,@Eva_Level,@Eva_Bak,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Code))
            {
                idb.AddParameter("@Eva_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Code", hR_Evaluation.Eva_Code);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_StuffCode))
            {
                idb.AddParameter("@Eva_StuffCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_StuffCode", hR_Evaluation.Eva_StuffCode);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_StuffName))
            {
                idb.AddParameter("@Eva_StuffName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_StuffName", hR_Evaluation.Eva_StuffName);
            }
            if (hR_Evaluation.Eva_Date == DateTime.MinValue)
            {
                idb.AddParameter("@Eva_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Date", hR_Evaluation.Eva_Date);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Records))
            {
                idb.AddParameter("@Eva_Records", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Records", hR_Evaluation.Eva_Records);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Conclusion))
            {
                idb.AddParameter("@Eva_Conclusion", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Conclusion", hR_Evaluation.Eva_Conclusion);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Manager))
            {
                idb.AddParameter("@Eva_Manager", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Manager", hR_Evaluation.Eva_Manager);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Level))
            {
                idb.AddParameter("@Eva_Level", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Level", hR_Evaluation.Eva_Level);
            }
            if (string.IsNullOrEmpty(hR_Evaluation.Eva_Bak))
            {
                idb.AddParameter("@Eva_Bak", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Eva_Bak", hR_Evaluation.Eva_Bak);
            }
            if (hR_Evaluation.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", hR_Evaluation.Stat);
            }
            if (hR_Evaluation.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", hR_Evaluation.CreateDate);
            }
            if (hR_Evaluation.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", hR_Evaluation.UpdateDate);
            }
            if (hR_Evaluation.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", hR_Evaluation.DeleteDate);
            }


            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);
        }
示例#16
0
        /// <summary>
        /// 添加请购单 WH_ApplyBuy对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(WH_ApplyBuy wH_ApplyBuy)
        {
            string sql = "INSERT INTO WH_ApplyBuy (MVI_Code,MVI_RCode,MVI_Type,MVI_MCode,MVI_Spec,MVI_Sup,MVI_Num,MVI_Unit,MVI_MDPrice,Stat,MV_CustCode,MV_CustName,MV_CustRef,MV_CustDate,MV_VerifyStep,MV_VerifyStuff,MV_VerifyDate,MV_VerifyStat,MV_ContractNo) VALUES (@MVI_Code,@MVI_RCode,@MVI_Type,@MVI_MCode,@MVI_Spec,@MVI_Sup,@MVI_Num,@MVI_Unit,@MVI_MDPrice,@Stat,@MV_CustCode,@MV_CustName,@MV_CustRef,@MV_CustDate,@MV_VerifyStep,@MV_VerifyStuff,@MV_VerifyDate,@MV_VerifyStat,@MV_ContractNo);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_Code))
            {
                idb.AddParameter("@MVI_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_Code", wH_ApplyBuy.MVI_Code);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_RCode))
            {
                idb.AddParameter("@MVI_RCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_RCode", wH_ApplyBuy.MVI_RCode);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_Type))
            {
                idb.AddParameter("@MVI_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_Type", wH_ApplyBuy.MVI_Type);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_MCode))
            {
                idb.AddParameter("@MVI_MCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_MCode", wH_ApplyBuy.MVI_MCode);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_Spec))
            {
                idb.AddParameter("@MVI_Spec", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_Spec", wH_ApplyBuy.MVI_Spec);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_Sup))
            {
                idb.AddParameter("@MVI_Sup", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_Sup", wH_ApplyBuy.MVI_Sup);
            }
            if (wH_ApplyBuy.MVI_Num == 0)
            {
                idb.AddParameter("@MVI_Num", 0);
            }
            else
            {
                idb.AddParameter("@MVI_Num", wH_ApplyBuy.MVI_Num);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MVI_Unit))
            {
                idb.AddParameter("@MVI_Unit", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MVI_Unit", wH_ApplyBuy.MVI_Unit);
            }
            if (wH_ApplyBuy.MVI_MDPrice == 0)
            {
                idb.AddParameter("@MVI_MDPrice", 0);
            }
            else
            {
                idb.AddParameter("@MVI_MDPrice", wH_ApplyBuy.MVI_MDPrice);
            }
            if (wH_ApplyBuy.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", wH_ApplyBuy.Stat);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_CustCode))
            {
                idb.AddParameter("@MV_CustCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_CustCode", wH_ApplyBuy.MV_CustCode);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_CustName))
            {
                idb.AddParameter("@MV_CustName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_CustName", wH_ApplyBuy.MV_CustName);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_CustRef))
            {
                idb.AddParameter("@MV_CustRef", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_CustRef", wH_ApplyBuy.MV_CustRef);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_CustDate))
            {
                idb.AddParameter("@MV_CustDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_CustDate", wH_ApplyBuy.MV_CustDate);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_VerifyStep))
            {
                idb.AddParameter("@MV_VerifyStep", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_VerifyStep", wH_ApplyBuy.MV_VerifyStep);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_VerifyStuff))
            {
                idb.AddParameter("@MV_VerifyStuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_VerifyStuff", wH_ApplyBuy.MV_VerifyStuff);
            }
            if (wH_ApplyBuy.MV_VerifyDate == DateTime.MinValue)
            {
                idb.AddParameter("@MV_VerifyDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_VerifyDate", wH_ApplyBuy.MV_VerifyDate);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_VerifyStat))
            {
                idb.AddParameter("@MV_VerifyStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_VerifyStat", wH_ApplyBuy.MV_VerifyStat);
            }
            if (string.IsNullOrEmpty(wH_ApplyBuy.MV_ContractNo))
            {
                idb.AddParameter("@MV_ContractNo", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MV_ContractNo", wH_ApplyBuy.MV_ContractNo);
            }


            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);
        }
示例#17
0
        /// <summary>
        /// 添加传真登记信息 Fax_Record对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Fax_Record fax_Record)
        {
            string sql = "INSERT INTO Fax_Record (FR_Code,FR_Date,FR_Content,FR_Category,FR_Num,FR_PageNum,FR_Amount,FR_Operator,FR_OpDate,FR_OpRemark,FR_TranferCompany,FR_TranferDept,FR_TranferRemark,FR_TranferDate,FR_Company,FR_Dept,FR_Stat,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@FR_Code,@FR_Date,@FR_Content,@FR_Category,@FR_Num,@FR_PageNum,@FR_Amount,@FR_Operator,@FR_OpDate,@FR_OpRemark,@FR_TranferCompany,@FR_TranferDept,@FR_TranferRemark,@FR_TranferDate,@FR_Company,@FR_Dept,@FR_Stat,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(fax_Record.FR_Code))
            {
                idb.AddParameter("@FR_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Code", fax_Record.FR_Code);
            }
            if (fax_Record.FR_Date == DateTime.MinValue)
            {
                idb.AddParameter("@FR_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Date", fax_Record.FR_Date);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Content))
            {
                idb.AddParameter("@FR_Content", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Content", fax_Record.FR_Content);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Category))
            {
                idb.AddParameter("@FR_Category", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Category", fax_Record.FR_Category);
            }
            if (fax_Record.FR_Num == 0)
            {
                idb.AddParameter("@FR_Num", 0);
            }
            else
            {
                idb.AddParameter("@FR_Num", fax_Record.FR_Num);
            }
            if (fax_Record.FR_PageNum == 0)
            {
                idb.AddParameter("@FR_PageNum", 0);
            }
            else
            {
                idb.AddParameter("@FR_PageNum", fax_Record.FR_PageNum);
            }
            if (fax_Record.FR_Amount == 0)
            {
                idb.AddParameter("@FR_Amount", 0);
            }
            else
            {
                idb.AddParameter("@FR_Amount", fax_Record.FR_Amount);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Operator))
            {
                idb.AddParameter("@FR_Operator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Operator", fax_Record.FR_Operator);
            }
            if (fax_Record.FR_OpDate == DateTime.MinValue)
            {
                idb.AddParameter("@FR_OpDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_OpDate", fax_Record.FR_OpDate);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_OpRemark))
            {
                idb.AddParameter("@FR_OpRemark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_OpRemark", fax_Record.FR_OpRemark);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_TranferCompany))
            {
                idb.AddParameter("@FR_TranferCompany", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_TranferCompany", fax_Record.FR_TranferCompany);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_TranferDept))
            {
                idb.AddParameter("@FR_TranferDept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_TranferDept", fax_Record.FR_TranferDept);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_TranferRemark))
            {
                idb.AddParameter("@FR_TranferRemark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_TranferRemark", fax_Record.FR_TranferRemark);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_TranferDate))
            {
                idb.AddParameter("@FR_TranferDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_TranferDate", fax_Record.FR_TranferDate);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Company))
            {
                idb.AddParameter("@FR_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Company", fax_Record.FR_Company);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Dept))
            {
                idb.AddParameter("@FR_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Dept", fax_Record.FR_Dept);
            }
            if (string.IsNullOrEmpty(fax_Record.FR_Stat))
            {
                idb.AddParameter("@FR_Stat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@FR_Stat", fax_Record.FR_Stat);
            }
            if (fax_Record.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", fax_Record.Stat);
            }
            if (fax_Record.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", fax_Record.CreateDate);
            }
            if (fax_Record.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", fax_Record.UpdateDate);
            }
            if (fax_Record.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", fax_Record.DeleteDate);
            }


            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);
        }
示例#18
0
        /// <summary>
        /// 添加纯净水空桶管理 EmptyPureWater_Manage对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(EmptyPureWater_Manage emptyPureWater_Manage)
        {
            string sql = "INSERT INTO EmptyPureWater_Manage (EPW_Code,EPW_Duty,EPW_EmptyPosition,EPW_Count,EPW_Remark,Stat,CreateDate,UpdateDate,DeleteDate,EPW_Company,EPW_Dept) VALUES (@EPW_Code,@EPW_Duty,@EPW_EmptyPosition,@EPW_Count,@EPW_Remark,@Stat,@CreateDate,@UpdateDate,@DeleteDate,@EPW_Company,@EPW_Dept);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_Code))
            {
                idb.AddParameter("@EPW_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_Code", emptyPureWater_Manage.EPW_Code);
            }
            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_Duty))
            {
                idb.AddParameter("@EPW_Duty", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_Duty", emptyPureWater_Manage.EPW_Duty);
            }
            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_EmptyPosition))
            {
                idb.AddParameter("@EPW_EmptyPosition", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_EmptyPosition", emptyPureWater_Manage.EPW_EmptyPosition);
            }
            if (emptyPureWater_Manage.EPW_Count == 0)
            {
                idb.AddParameter("@EPW_Count", 0);
            }
            else
            {
                idb.AddParameter("@EPW_Count", emptyPureWater_Manage.EPW_Count);
            }
            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_Remark))
            {
                idb.AddParameter("@EPW_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_Remark", emptyPureWater_Manage.EPW_Remark);
            }
            if (emptyPureWater_Manage.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", emptyPureWater_Manage.Stat);
            }
            if (emptyPureWater_Manage.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", emptyPureWater_Manage.CreateDate);
            }
            if (emptyPureWater_Manage.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", emptyPureWater_Manage.UpdateDate);
            }
            if (emptyPureWater_Manage.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", emptyPureWater_Manage.DeleteDate);
            }
            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_Company))
            {
                idb.AddParameter("@EPW_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_Company", emptyPureWater_Manage.EPW_Company);
            }
            if (string.IsNullOrEmpty(emptyPureWater_Manage.EPW_Dept))
            {
                idb.AddParameter("@EPW_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@EPW_Dept", emptyPureWater_Manage.EPW_Dept);
            }


            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);
        }
示例#19
0
        /// <summary>
        /// 添加考勤信息 HR_TimeSheet对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(HR_TimeSheet hR_TimeSheet)
        {
            string sql = "INSERT INTO HR_TimeSheet (TS_Code,TS_StuffName,TS_StuffCode,TS_Type,TS_TypeName,TS_Start,TS_End,TS_Total,TS_Matter,Creator,CreateTime,VerifyStat,VerifyDate,VerifyStuff,VerifyNext,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@TS_Code,@TS_StuffName,@TS_StuffCode,@TS_Type,@TS_TypeName,@TS_Start,@TS_End,@TS_Total,@TS_Matter,@Creator,@CreateTime,@VerifyStat,@VerifyDate,@VerifyStuff,@VerifyNext,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(hR_TimeSheet.TS_Code))
            {
                idb.AddParameter("@TS_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_Code", hR_TimeSheet.TS_Code);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.TS_StuffName))
            {
                idb.AddParameter("@TS_StuffName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_StuffName", hR_TimeSheet.TS_StuffName);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.TS_StuffCode))
            {
                idb.AddParameter("@TS_StuffCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_StuffCode", hR_TimeSheet.TS_StuffCode);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.TS_Type))
            {
                idb.AddParameter("@TS_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_Type", hR_TimeSheet.TS_Type);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.TS_TypeName))
            {
                idb.AddParameter("@TS_TypeName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_TypeName", hR_TimeSheet.TS_TypeName);
            }
            if (hR_TimeSheet.TS_Start == DateTime.MinValue)
            {
                idb.AddParameter("@TS_Start", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_Start", hR_TimeSheet.TS_Start);
            }
            if (hR_TimeSheet.TS_End == DateTime.MinValue)
            {
                idb.AddParameter("@TS_End", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_End", hR_TimeSheet.TS_End);
            }
            if (hR_TimeSheet.TS_Total == 0)
            {
                idb.AddParameter("@TS_Total", 0);
            }
            else
            {
                idb.AddParameter("@TS_Total", hR_TimeSheet.TS_Total);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.TS_Matter))
            {
                idb.AddParameter("@TS_Matter", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@TS_Matter", hR_TimeSheet.TS_Matter);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.Creator))
            {
                idb.AddParameter("@Creator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Creator", hR_TimeSheet.Creator);
            }
            if (hR_TimeSheet.CreateTime == DateTime.MinValue)
            {
                idb.AddParameter("@CreateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateTime", hR_TimeSheet.CreateTime);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.VerifyStat))
            {
                idb.AddParameter("@VerifyStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStat", hR_TimeSheet.VerifyStat);
            }
            if (hR_TimeSheet.VerifyDate == DateTime.MinValue)
            {
                idb.AddParameter("@VerifyDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyDate", hR_TimeSheet.VerifyDate);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.VerifyStuff))
            {
                idb.AddParameter("@VerifyStuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStuff", hR_TimeSheet.VerifyStuff);
            }
            if (string.IsNullOrEmpty(hR_TimeSheet.VerifyNext))
            {
                idb.AddParameter("@VerifyNext", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNext", hR_TimeSheet.VerifyNext);
            }
            if (hR_TimeSheet.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", hR_TimeSheet.Stat);
            }
            if (hR_TimeSheet.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", hR_TimeSheet.CreateDate);
            }
            if (hR_TimeSheet.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", hR_TimeSheet.UpdateDate);
            }
            if (hR_TimeSheet.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", hR_TimeSheet.DeleteDate);
            }


            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);
        }
示例#20
0
        /// <summary>
        /// 添加设备检修计划 Equ_MPlan对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Equ_MPlan equ_MPlan)
        {
            string sql = "INSERT INTO Equ_MPlan (MP_Code,MP_Name,MP_Stuff,MP_Start,MP_End,VerifyStuff,VerifyStat,VerifyDate,Stat,MP_ECode,MP_EName) VALUES (@MP_Code,@MP_Name,@MP_Stuff,@MP_Start,@MP_End,@VerifyStuff,@VerifyStat,@VerifyDate,@Stat,@MP_ECode,@MP_EName);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(equ_MPlan.MP_Code))
            {
                idb.AddParameter("@MP_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Code", equ_MPlan.MP_Code);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_Name))
            {
                idb.AddParameter("@MP_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Name", equ_MPlan.MP_Name);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_Stuff))
            {
                idb.AddParameter("@MP_Stuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Stuff", equ_MPlan.MP_Stuff);
            }
            if (equ_MPlan.MP_Start == DateTime.MinValue)
            {
                idb.AddParameter("@MP_Start", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Start", equ_MPlan.MP_Start);
            }
            if (equ_MPlan.MP_End == DateTime.MinValue)
            {
                idb.AddParameter("@MP_End", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_End", equ_MPlan.MP_End);
            }
            if (string.IsNullOrEmpty(equ_MPlan.VerifyStuff))
            {
                idb.AddParameter("@VerifyStuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStuff", equ_MPlan.VerifyStuff);
            }
            if (string.IsNullOrEmpty(equ_MPlan.VerifyStat))
            {
                idb.AddParameter("@VerifyStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStat", equ_MPlan.VerifyStat);
            }
            if (equ_MPlan.VerifyDate == DateTime.MinValue)
            {
                idb.AddParameter("@VerifyDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyDate", equ_MPlan.VerifyDate);
            }
            if (equ_MPlan.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", equ_MPlan.Stat);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_ECode))
            {
                idb.AddParameter("@MP_ECode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_ECode", equ_MPlan.MP_ECode);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_EName))
            {
                idb.AddParameter("@MP_EName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_EName", equ_MPlan.MP_EName);
            }


            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);
        }
示例#21
0
        /// <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);
        }
示例#22
0
        /// <summary>
        /// 添加Bse_Station对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Bse_Station bse_Station)
        {
            string sql = "INSERT INTO Bse_Station (SN_Code,SN_Name,SN_AreaCode,SN_AreaName,SN_Mark,SN_Number,SN_Bak,SN_Interval,Stat,CreateTime,UpdateTime,DeleteTime) VALUES (@SN_Code,@SN_Name,@SN_AreaCode,@SN_AreaName,@SN_Mark,@SN_Number,@SN_Bak,@SN_Interval,@Stat,@CreateTime,@UpdateTime,@DeleteTime);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(bse_Station.SN_Code))
            {
                idb.AddParameter("@SN_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_Code", bse_Station.SN_Code);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_Name))
            {
                idb.AddParameter("@SN_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_Name", bse_Station.SN_Name);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_AreaCode))
            {
                idb.AddParameter("@SN_AreaCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_AreaCode", bse_Station.SN_AreaCode);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_AreaName))
            {
                idb.AddParameter("@SN_AreaName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_AreaName", bse_Station.SN_AreaName);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_Mark))
            {
                idb.AddParameter("@SN_Mark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_Mark", bse_Station.SN_Mark);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_Number))
            {
                idb.AddParameter("@SN_Number", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_Number", bse_Station.SN_Number);
            }
            if (string.IsNullOrEmpty(bse_Station.SN_Bak))
            {
                idb.AddParameter("@SN_Bak", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SN_Bak", bse_Station.SN_Bak);
            }
            if (bse_Station.SN_Interval == 0)
            {
                idb.AddParameter("@SN_Interval", 0);
            }
            else
            {
                idb.AddParameter("@SN_Interval", bse_Station.SN_Interval);
            }
            if (bse_Station.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", bse_Station.Stat);
            }
            if (bse_Station.CreateTime == DateTime.MinValue)
            {
                idb.AddParameter("@CreateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateTime", bse_Station.CreateTime);
            }
            if (bse_Station.UpdateTime == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateTime", bse_Station.UpdateTime);
            }
            if (bse_Station.DeleteTime == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteTime", bse_Station.DeleteTime);
            }

            return(idb.ReturnValue(sql));
        }
示例#23
0
        /// <summary>
        /// 添加公司物料类别 WH_MaterialType对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(WH_MaterialType wH_MaterialType)
        {
            string sql = "INSERT INTO WH_MaterialType (MT_Code,MT_TCode,MT_TName,MT_Company,MT_CompanyCode,MT_Dept,MT_DeptCode,Stat,MT_Status,CreateDate,UpdateDate,DeleteDate,MT_Itype,MT_Type,MT_Employee,MT_EmployeeName,MT_TPCode,MT_Order) VALUES (@MT_Code,@MT_TCode,@MT_TName,@MT_Company,@MT_CompanyCode,@MT_Dept,@MT_DeptCode,@Stat,@MT_Status,@CreateDate,@UpdateDate,@DeleteDate,@MT_Itype,@MT_Type,@MT_Employee,@MT_EmployeeName,@MT_TPCode,@MT_Order);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(wH_MaterialType.MT_Code))
            {
                idb.AddParameter("@MT_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Code", wH_MaterialType.MT_Code);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TCode))
            {
                idb.AddParameter("@MT_TCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TCode", wH_MaterialType.MT_TCode);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TName))
            {
                idb.AddParameter("@MT_TName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TName", wH_MaterialType.MT_TName);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Company))
            {
                idb.AddParameter("@MT_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Company", wH_MaterialType.MT_Company);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_CompanyCode))
            {
                idb.AddParameter("@MT_CompanyCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_CompanyCode", wH_MaterialType.MT_CompanyCode);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Dept))
            {
                idb.AddParameter("@MT_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Dept", wH_MaterialType.MT_Dept);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_DeptCode))
            {
                idb.AddParameter("@MT_DeptCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_DeptCode", wH_MaterialType.MT_DeptCode);
            }
            if (wH_MaterialType.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", wH_MaterialType.Stat);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Status))
            {
                idb.AddParameter("@MT_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Status", wH_MaterialType.MT_Status);
            }
            if (wH_MaterialType.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", wH_MaterialType.CreateDate);
            }
            if (wH_MaterialType.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", wH_MaterialType.UpdateDate);
            }
            if (wH_MaterialType.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", wH_MaterialType.DeleteDate);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Itype))
            {
                idb.AddParameter("@MT_Itype", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Itype", wH_MaterialType.MT_Itype);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Type))
            {
                idb.AddParameter("@MT_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Type", wH_MaterialType.MT_Type);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Employee))
            {
                idb.AddParameter("@MT_Employee", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Employee", wH_MaterialType.MT_Employee);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_EmployeeName))
            {
                idb.AddParameter("@MT_EmployeeName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_EmployeeName", wH_MaterialType.MT_EmployeeName);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TPCode))
            {
                idb.AddParameter("@MT_TPCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TPCode", wH_MaterialType.MT_TPCode);
            }
            if (wH_MaterialType.MT_Order == 0)
            {
                idb.AddParameter("@MT_Order", 0);
            }
            else
            {
                idb.AddParameter("@MT_Order", wH_MaterialType.MT_Order);
            }


            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);
        }
示例#24
0
        /// <summary>
        /// 添加系统菜单 System_Menu对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(System_Menu system_Menu)
        {
            string sql = "INSERT INTO System_Menu (Menu_Code,Menu_Title,Menu_Location,Menu_PCode,Menu_Enable,Menu_Url,Menu_Order,Menu_Icon,Stat,Shortcut) VALUES (@Menu_Code,@Menu_Title,@Menu_Location,@Menu_PCode,@Menu_Enable,@Menu_Url,@Menu_Order,@Menu_Icon,@Stat,@Shortcut);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(system_Menu.Menu_Code))
            {
                idb.AddParameter("@Menu_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Code", system_Menu.Menu_Code);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_Title))
            {
                idb.AddParameter("@Menu_Title", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Title", system_Menu.Menu_Title);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_Location))
            {
                idb.AddParameter("@Menu_Location", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Location", system_Menu.Menu_Location);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_PCode))
            {
                idb.AddParameter("@Menu_PCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_PCode", system_Menu.Menu_PCode);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_Enable))
            {
                idb.AddParameter("@Menu_Enable", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Enable", system_Menu.Menu_Enable);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_Url))
            {
                idb.AddParameter("@Menu_Url", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Url", system_Menu.Menu_Url);
            }
            if (system_Menu.Menu_Order == 0)
            {
                idb.AddParameter("@Menu_Order", 0);
            }
            else
            {
                idb.AddParameter("@Menu_Order", system_Menu.Menu_Order);
            }
            if (string.IsNullOrEmpty(system_Menu.Menu_Icon))
            {
                idb.AddParameter("@Menu_Icon", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Menu_Icon", system_Menu.Menu_Icon);
            }
            if (system_Menu.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", system_Menu.Stat);
            }
            if (system_Menu.Shortcut == 0)
            {
                idb.AddParameter("@Shortcut", 0);
            }
            else
            {
                idb.AddParameter("@Shortcut", system_Menu.Shortcut);
            }


            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);
        }
示例#25
0
        /// <summary>
        /// 添加Doc_Attachment对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Doc_Attachment doc_Attachment)
        {
            string sql = "INSERT INTO Doc_Attachment (Dat_Code,Dat_Name,Dat_Path,Dat_Module,Dat_RefCode,Dat_Type,Dat_Stat,Dat_Order,Dat_Date,Dat_Creator,Dat_CreatorName,CreateTime,UpdateTime,DeleteTime,Stat,Dat_Udef1,Dat_Udef2,Dat_Udef3,Dat_Udef4,Dat_ShowName) VALUES (@Dat_Code,@Dat_Name,@Dat_Path,@Dat_Module,@Dat_RefCode,@Dat_Type,@Dat_Stat,@Dat_Order,@Dat_Date,@Dat_Creator,@Dat_CreatorName,@CreateTime,@UpdateTime,@DeleteTime,@Stat,@Dat_Udef1,@Dat_Udef2,@Dat_Udef3,@Dat_Udef4,@Dat_ShowName);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(doc_Attachment.Dat_Code))
            {
                idb.AddParameter("@Dat_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Code", doc_Attachment.Dat_Code);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Name))
            {
                idb.AddParameter("@Dat_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Name", doc_Attachment.Dat_Name);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Path))
            {
                idb.AddParameter("@Dat_Path", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Path", doc_Attachment.Dat_Path);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Module))
            {
                idb.AddParameter("@Dat_Module", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Module", doc_Attachment.Dat_Module);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_RefCode))
            {
                idb.AddParameter("@Dat_RefCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_RefCode", doc_Attachment.Dat_RefCode);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Type))
            {
                idb.AddParameter("@Dat_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Type", doc_Attachment.Dat_Type);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Stat))
            {
                idb.AddParameter("@Dat_Stat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Stat", doc_Attachment.Dat_Stat);
            }
            if (doc_Attachment.Dat_Order == 0)
            {
                idb.AddParameter("@Dat_Order", 0);
            }
            else
            {
                idb.AddParameter("@Dat_Order", doc_Attachment.Dat_Order);
            }
            if (doc_Attachment.Dat_Date == DateTime.MinValue)
            {
                idb.AddParameter("@Dat_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Date", doc_Attachment.Dat_Date);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Creator))
            {
                idb.AddParameter("@Dat_Creator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Creator", doc_Attachment.Dat_Creator);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_CreatorName))
            {
                idb.AddParameter("@Dat_CreatorName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_CreatorName", doc_Attachment.Dat_CreatorName);
            }
            if (doc_Attachment.CreateTime == DateTime.MinValue)
            {
                idb.AddParameter("@CreateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateTime", doc_Attachment.CreateTime);
            }
            if (doc_Attachment.UpdateTime == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateTime", doc_Attachment.UpdateTime);
            }
            if (doc_Attachment.DeleteTime == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteTime", doc_Attachment.DeleteTime);
            }
            if (doc_Attachment.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", doc_Attachment.Stat);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Udef1))
            {
                idb.AddParameter("@Dat_Udef1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Udef1", doc_Attachment.Dat_Udef1);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Udef2))
            {
                idb.AddParameter("@Dat_Udef2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Udef2", doc_Attachment.Dat_Udef2);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Udef3))
            {
                idb.AddParameter("@Dat_Udef3", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Udef3", doc_Attachment.Dat_Udef3);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_Udef4))
            {
                idb.AddParameter("@Dat_Udef4", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_Udef4", doc_Attachment.Dat_Udef4);
            }
            if (string.IsNullOrEmpty(doc_Attachment.Dat_ShowName))
            {
                idb.AddParameter("@Dat_ShowName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Dat_ShowName", doc_Attachment.Dat_ShowName);
            }

            return(idb.ReturnValue(sql));
        }
示例#26
0
        /// <summary>
        /// 添加通用参考主表 Sys_Config_Refer对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Sys_Config_Refer sys_Config_Refer)
        {
            string sql = "INSERT INTO Sys_Config_Refer (R_ModuleName,R_NameSpace,R_Title,R_Width,R_Height,Stat,R_TableName,R_FilterSql,R_SQL,R_Url) VALUES (@R_ModuleName,@R_NameSpace,@R_Title,@R_Width,@R_Height,@Stat,@R_TableName,@R_FilterSql,@R_SQL,@R_Url);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(sys_Config_Refer.R_ModuleName))
            {
                idb.AddParameter("@R_ModuleName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_ModuleName", sys_Config_Refer.R_ModuleName);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_NameSpace))
            {
                idb.AddParameter("@R_NameSpace", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_NameSpace", sys_Config_Refer.R_NameSpace);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_Title))
            {
                idb.AddParameter("@R_Title", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_Title", sys_Config_Refer.R_Title);
            }
            if (sys_Config_Refer.R_Width == 0)
            {
                idb.AddParameter("@R_Width", 0);
            }
            else
            {
                idb.AddParameter("@R_Width", sys_Config_Refer.R_Width);
            }
            if (sys_Config_Refer.R_Height == 0)
            {
                idb.AddParameter("@R_Height", 0);
            }
            else
            {
                idb.AddParameter("@R_Height", sys_Config_Refer.R_Height);
            }
            if (sys_Config_Refer.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", sys_Config_Refer.Stat);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_TableName))
            {
                idb.AddParameter("@R_TableName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_TableName", sys_Config_Refer.R_TableName);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_FilterSql))
            {
                idb.AddParameter("@R_FilterSql", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_FilterSql", sys_Config_Refer.R_FilterSql);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_SQL))
            {
                idb.AddParameter("@R_SQL", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_SQL", sys_Config_Refer.R_SQL);
            }
            if (string.IsNullOrEmpty(sys_Config_Refer.R_Url))
            {
                idb.AddParameter("@R_Url", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@R_Url", sys_Config_Refer.R_Url);
            }

            return(idb.ReturnValue(sql));
        }
示例#27
0
        /// <summary>
        /// 添加GPSRecord对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(GPSRecord gPSRecord)
        {
            string sql = "INSERT INTO GPSRecord (License_Plate,Terminal_ID,PlateColor,DataType,GPSTime,Longitude,Latitude,GPSFlag,Speed,Direction,Comm_Type,MDTStatus,MDTAlarm,Data_Length,DataContend,Stat,CreateTime) VALUES (@License_Plate,@Terminal_ID,@PlateColor,@DataType,@GPSTime,@Longitude,@Latitude,@GPSFlag,@Speed,@Direction,@Comm_Type,@MDTStatus,@MDTAlarm,@Data_Length,@DataContend,@Stat,@CreateTime);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(gPSRecord.License_Plate))
            {
                idb.AddParameter("@License_Plate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@License_Plate", gPSRecord.License_Plate);
            }
            if (string.IsNullOrEmpty(gPSRecord.Terminal_ID))
            {
                idb.AddParameter("@Terminal_ID", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Terminal_ID", gPSRecord.Terminal_ID);
            }
            if (gPSRecord.PlateColor == 0)
            {
                idb.AddParameter("@PlateColor", 0);
            }
            else
            {
                idb.AddParameter("@PlateColor", gPSRecord.PlateColor);
            }
            if (gPSRecord.DataType == 0)
            {
                idb.AddParameter("@DataType", 0);
            }
            else
            {
                idb.AddParameter("@DataType", gPSRecord.DataType);
            }
            if (gPSRecord.GPSTime == DateTime.MinValue)
            {
                idb.AddParameter("@GPSTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@GPSTime", gPSRecord.GPSTime);
            }
            if (gPSRecord.Longitude == 0)
            {
                idb.AddParameter("@Longitude", 0);
            }
            else
            {
                idb.AddParameter("@Longitude", gPSRecord.Longitude);
            }
            if (gPSRecord.Latitude == 0)
            {
                idb.AddParameter("@Latitude", 0);
            }
            else
            {
                idb.AddParameter("@Latitude", gPSRecord.Latitude);
            }
            if (gPSRecord.GPSFlag == 0)
            {
                idb.AddParameter("@GPSFlag", 0);
            }
            else
            {
                idb.AddParameter("@GPSFlag", gPSRecord.GPSFlag);
            }
            if (gPSRecord.Speed == 0)
            {
                idb.AddParameter("@Speed", 0);
            }
            else
            {
                idb.AddParameter("@Speed", gPSRecord.Speed);
            }
            if (gPSRecord.Direction == 0)
            {
                idb.AddParameter("@Direction", 0);
            }
            else
            {
                idb.AddParameter("@Direction", gPSRecord.Direction);
            }
            if (gPSRecord.Comm_Type == 0)
            {
                idb.AddParameter("@Comm_Type", 0);
            }
            else
            {
                idb.AddParameter("@Comm_Type", gPSRecord.Comm_Type);
            }
            if (gPSRecord.MDTStatus == 0)
            {
                idb.AddParameter("@MDTStatus", 0);
            }
            else
            {
                idb.AddParameter("@MDTStatus", gPSRecord.MDTStatus);
            }
            if (gPSRecord.MDTAlarm == 0)
            {
                idb.AddParameter("@MDTAlarm", 0);
            }
            else
            {
                idb.AddParameter("@MDTAlarm", gPSRecord.MDTAlarm);
            }
            if (gPSRecord.Data_Length == 0)
            {
                idb.AddParameter("@Data_Length", 0);
            }
            else
            {
                idb.AddParameter("@Data_Length", gPSRecord.Data_Length);
            }
            if (string.IsNullOrEmpty(gPSRecord.DataContend))
            {
                idb.AddParameter("@DataContend", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DataContend", gPSRecord.DataContend);
            }
            if (gPSRecord.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", gPSRecord.Stat);
            }
            if (gPSRecord.CreateTime == DateTime.MinValue)
            {
                idb.AddParameter("@CreateTime", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateTime", gPSRecord.CreateTime);
            }

            return(idb.ReturnValue(sql));
        }
示例#28
0
        /// <summary>
        /// 添加计量信息 Measure_Details对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Measure_Details measure_Details)
        {
            string sql = "INSERT INTO Measure_Details (Measure_Code,Measure_LoadometerCode,Measure_ItemName,Measure_Item,Measure_Result,Measure_Remark,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@Measure_Code,@Measure_LoadometerCode,@Measure_ItemName,@Measure_Item,@Measure_Result,@Measure_Remark,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(measure_Details.Measure_Code))
            {
                idb.AddParameter("@Measure_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Measure_Code", measure_Details.Measure_Code);
            }
            if (string.IsNullOrEmpty(measure_Details.Measure_LoadometerCode))
            {
                idb.AddParameter("@Measure_LoadometerCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Measure_LoadometerCode", measure_Details.Measure_LoadometerCode);
            }
            if (string.IsNullOrEmpty(measure_Details.Measure_ItemName))
            {
                idb.AddParameter("@Measure_ItemName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Measure_ItemName", measure_Details.Measure_ItemName);
            }
            if (string.IsNullOrEmpty(measure_Details.Measure_Item))
            {
                idb.AddParameter("@Measure_Item", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Measure_Item", measure_Details.Measure_Item);
            }
            if (measure_Details.Measure_Result == 0)
            {
                idb.AddParameter("@Measure_Result", 0);
            }
            else
            {
                idb.AddParameter("@Measure_Result", measure_Details.Measure_Result);
            }
            if (string.IsNullOrEmpty(measure_Details.Measure_Remark))
            {
                idb.AddParameter("@Measure_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Measure_Remark", measure_Details.Measure_Remark);
            }
            if (measure_Details.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", measure_Details.Stat);
            }
            if (measure_Details.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", measure_Details.CreateDate);
            }
            if (measure_Details.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", measure_Details.UpdateDate);
            }
            if (measure_Details.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", measure_Details.DeleteDate);
            }


            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);
        }
示例#29
0
        /// <summary>
        /// 添加外联协调信息 Outreach_Coordination对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Outreach_Coordination outreach_Coordination)
        {
            string sql = "INSERT INTO Outreach_Coordination (OC_Code,OC_OutretachCode,OC_OutreachName,OC_CoordinationType,OC_MainContactor,OC_Telephone,OC_Content,OC_Result,OC_ResultType,OC_Cost,OC_Remark,OC_Attachment,OC_Company,OC_Dept,OC_iType,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@OC_Code,@OC_OutretachCode,@OC_OutreachName,@OC_CoordinationType,@OC_MainContactor,@OC_Telephone,@OC_Content,@OC_Result,@OC_ResultType,@OC_Cost,@OC_Remark,@OC_Attachment,@OC_Company,@OC_Dept,@OC_iType,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(outreach_Coordination.OC_Code))
            {
                idb.AddParameter("@OC_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Code", outreach_Coordination.OC_Code);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_OutretachCode))
            {
                idb.AddParameter("@OC_OutretachCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_OutretachCode", outreach_Coordination.OC_OutretachCode);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_OutreachName))
            {
                idb.AddParameter("@OC_OutreachName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_OutreachName", outreach_Coordination.OC_OutreachName);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_CoordinationType))
            {
                idb.AddParameter("@OC_CoordinationType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_CoordinationType", outreach_Coordination.OC_CoordinationType);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_MainContactor))
            {
                idb.AddParameter("@OC_MainContactor", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_MainContactor", outreach_Coordination.OC_MainContactor);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Telephone))
            {
                idb.AddParameter("@OC_Telephone", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Telephone", outreach_Coordination.OC_Telephone);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Content))
            {
                idb.AddParameter("@OC_Content", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Content", outreach_Coordination.OC_Content);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Result))
            {
                idb.AddParameter("@OC_Result", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Result", outreach_Coordination.OC_Result);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_ResultType))
            {
                idb.AddParameter("@OC_ResultType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_ResultType", outreach_Coordination.OC_ResultType);
            }
            if (outreach_Coordination.OC_Cost == 0)
            {
                idb.AddParameter("@OC_Cost", 0);
            }
            else
            {
                idb.AddParameter("@OC_Cost", outreach_Coordination.OC_Cost);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Remark))
            {
                idb.AddParameter("@OC_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Remark", outreach_Coordination.OC_Remark);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Attachment))
            {
                idb.AddParameter("@OC_Attachment", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Attachment", outreach_Coordination.OC_Attachment);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Company))
            {
                idb.AddParameter("@OC_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Company", outreach_Coordination.OC_Company);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Dept))
            {
                idb.AddParameter("@OC_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Dept", outreach_Coordination.OC_Dept);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_iType))
            {
                idb.AddParameter("@OC_iType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_iType", outreach_Coordination.OC_iType);
            }
            if (outreach_Coordination.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", outreach_Coordination.Stat);
            }
            if (outreach_Coordination.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", outreach_Coordination.CreateDate);
            }
            if (outreach_Coordination.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", outreach_Coordination.UpdateDate);
            }
            if (outreach_Coordination.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", outreach_Coordination.DeleteDate);
            }


            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);
        }
示例#30
0
        /// <summary>
        /// 添加Assets_Apply对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Assets_Apply assets_Apply)
        {
            string sql = "INSERT INTO Assets_Apply (AssetsApply_Code,AssetsApply_AppPerson,AssetsApply_AppDept,AssetsApply_AppName,AssetsApply_Parameter,AssetsApply_Description,AssetsApply_AppCount,AssetsApply_Type,AssetsApply_AppType,AssetsApply_Date,AssetsApply_AudistStat,AssetsApply_Stat,AssetsApply_Remark,Stat) VALUES (@AssetsApply_Code,@AssetsApply_AppPerson,@AssetsApply_AppDept,@AssetsApply_AppName,@AssetsApply_Parameter,@AssetsApply_Description,@AssetsApply_AppCount,@AssetsApply_Type,@AssetsApply_AppType,@AssetsApply_Date,@AssetsApply_AudistStat,@AssetsApply_Stat,@AssetsApply_Remark,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Code))
            {
                idb.AddParameter("@AssetsApply_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Code", assets_Apply.AssetsApply_Code);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppPerson))
            {
                idb.AddParameter("@AssetsApply_AppPerson", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppPerson", assets_Apply.AssetsApply_AppPerson);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppDept))
            {
                idb.AddParameter("@AssetsApply_AppDept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppDept", assets_Apply.AssetsApply_AppDept);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppName))
            {
                idb.AddParameter("@AssetsApply_AppName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppName", assets_Apply.AssetsApply_AppName);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Parameter))
            {
                idb.AddParameter("@AssetsApply_Parameter", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Parameter", assets_Apply.AssetsApply_Parameter);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Description))
            {
                idb.AddParameter("@AssetsApply_Description", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Description", assets_Apply.AssetsApply_Description);
            }
            if (assets_Apply.AssetsApply_AppCount == 0)
            {
                idb.AddParameter("@AssetsApply_AppCount", 0);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppCount", assets_Apply.AssetsApply_AppCount);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Type))
            {
                idb.AddParameter("@AssetsApply_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Type", assets_Apply.AssetsApply_Type);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppType))
            {
                idb.AddParameter("@AssetsApply_AppType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppType", assets_Apply.AssetsApply_AppType);
            }
            if (assets_Apply.AssetsApply_Date == DateTime.MinValue)
            {
                idb.AddParameter("@AssetsApply_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Date", assets_Apply.AssetsApply_Date);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AudistStat))
            {
                idb.AddParameter("@AssetsApply_AudistStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AudistStat", assets_Apply.AssetsApply_AudistStat);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Stat))
            {
                idb.AddParameter("@AssetsApply_Stat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Stat", assets_Apply.AssetsApply_Stat);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Remark))
            {
                idb.AddParameter("@AssetsApply_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Remark", assets_Apply.AssetsApply_Remark);
            }
            if (assets_Apply.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", assets_Apply.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);
        }