当前位置: 首页>>代码示例>>C#>>正文


C# DataAccessLayer.ExecNonQuery方法代码示例

本文整理汇总了C#中DataAccessLayer.ExecNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccessLayer.ExecNonQuery方法的具体用法?C# DataAccessLayer.ExecNonQuery怎么用?C# DataAccessLayer.ExecNonQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataAccessLayer的用法示例。


在下文中一共展示了DataAccessLayer.ExecNonQuery方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteRecord

        public bool DeleteRecord(IModelObject KeyObject)
        {
            string sqlString = string.Empty;
            bool isSuccess = false;

            sqlString = "DELETE FROM " + this._dataBaseDic[CodeMasterInfoEnum.TableName.ToString()] + this._newLineSybm;

            sqlString += " WHERE " + this._dataBaseDic[CodeMasterInfoEnum.CmtIRecID.ToString()] + "=" + KeyObject.RecordID.ToString();

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(sqlString);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:21,代码来源:CodeMasterDA.cs

示例2: DeleteRecord

        public bool DeleteRecord(IModelObject KeyObject)
        {
            string l_strSQL = string.Empty;
            bool isSuccess = false;

            l_strSQL = "DELETE ClientMaster_clm ";

            l_strSQL += " WHERE clm_iRecID=" + KeyObject.RecordID.ToString();

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(l_strSQL);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:21,代码来源:ClientMasterDA.cs

示例3: UpdateRecord

        public bool UpdateRecord(CodeMasterInfo infoObject)
        {
            string sqlString = string.Empty;
            bool isSuccess = false;

            if (infoObject == null)
            {
                return isSuccess;
            }

            sqlString = "UPDATE " + this._dataBaseDic[CodeMasterInfoEnum.TableName.ToString()] + " SET " + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCValue.ToString()] + "='" + infoObject.CmtCValue.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtFNumber.ToString()] + "=" + infoObject.CmtFNumber.ToString() + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCRemark.ToString()] + "='" + infoObject.CmtCRemark.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCRemark2.ToString()] + "='" + infoObject.CmtCRemark2.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCLast.ToString()] + "='" + infoObject.CmtCLast.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            if (infoObject.CmtDLastDate == null)
            {
                sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtDLastDate.ToString()] + "=NULL" + this._newLineSybm;
            }
            else
            {
                sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtDLastDate.ToString()] + "='" + infoObject.CmtDLastDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "'" + this._newLineSybm;
            }
            sqlString += " WHERE " + this._dataBaseDic[CodeMasterInfoEnum.CmtIRecID.ToString()] + "=" + infoObject.CmtIRecID.ToString();

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(sqlString);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:38,代码来源:CodeMasterDA.cs

示例4: InsertRecord

        public bool InsertRecord(CodeMasterInfo infoObject)
        {
            string sqlString = string.Empty;
            bool isSuccess = false;

            if (infoObject == null)
            {
                return isSuccess;
            }

            sqlString = "INSERT INTO " + this._dataBaseDic[CodeMasterInfoEnum.TableName.ToString()] + "(" + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCKey1.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCKey2.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCValue.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtFNumber.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCRemark.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCRemark2.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCAdd.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtDAddDate.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtCLast.ToString()] + "," + this._newLineSybm;
            sqlString += this._dataBaseDic[CodeMasterInfoEnum.CmtDLastDate.ToString()] + ")" + this._newLineSybm;
            sqlString += "VALUES(" + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCKey1.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCKey2.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCValue.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += infoObject.CmtFNumber.ToString() + "," + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCRemark.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCRemark2.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            sqlString += "'" + infoObject.CmtCAdd.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            if (infoObject.CmtDAddDate == null)
            {
                sqlString += "NULL," + this._newLineSybm;
            }
            else
            {
                sqlString += "'" + infoObject.CmtDAddDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "'," + this._newLineSybm;
            }
            sqlString += "'" + infoObject.CmtCLast.Trim().Replace("'", "''") + "'," + this._newLineSybm;
            if (infoObject.CmtDLastDate == null)
            {
                sqlString += "NULL)" + this._newLineSybm;
            }
            else
            {
                sqlString += "'" + infoObject.CmtDLastDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "')" + this._newLineSybm;
            }

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(sqlString);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:59,代码来源:CodeMasterDA.cs

示例5: UpdateRecord

        public bool UpdateRecord(ClientMasterInfo infoObject)
        {
            string l_strSQL = string.Empty;
            bool isSuccess = false;

            if (infoObject == null)
            {
                return isSuccess;
            }

            l_strSQL = "UPDATE ClientMaster_clm SET ";
            l_strSQL += "clm_cEnglishName='"+infoObject.ClmCEnglishName.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cChinaName=N'"+infoObject.ClmCChinaName.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cTaxNumber=N'" + infoObject.ClmCTaxNumber.Replace("'", "''").Trim() + "'," + Environment.NewLine;
            l_strSQL += "clm_cLinkman=N'"+infoObject.ClmCLinkman.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cAddress=N'"+infoObject.ClmCAddress.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cPhone=N'"+infoObject.ClmCPhone.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cFax=N'"+infoObject.ClmCFax.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cWebSite=N'"+infoObject.ClmCWebSite.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cRemark=N'"+infoObject.ClmCRemark.Replace("'", "''").Trim()+"'," + Environment.NewLine;
            l_strSQL += "clm_cLast='"+infoObject.ClmCLast.Replace("'", "''")+"'," + Environment.NewLine;
            l_strSQL += "clm_dLastDate=GETDATE() " + Environment.NewLine;
            l_strSQL += " WHERE clm_iRecID=" + infoObject.ClmIRecID.ToString();

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(l_strSQL);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:36,代码来源:ClientMasterDA.cs

示例6: InsertRecord

        public bool InsertRecord(ClientMasterInfo infoObject)
        {
            string l_strSQL = string.Empty;
            bool isSuccess = false;

            if (infoObject == null)
            {
                return isSuccess;
            }

            l_strSQL = "INSERT ClientMaster_clm(";
            l_strSQL += "clm_cClientNum," + Environment.NewLine;
            l_strSQL += "clm_cEnglishName," + Environment.NewLine;
            l_strSQL += "clm_cChinaName," + Environment.NewLine;
            l_strSQL += "clm_cTaxNumber," + Environment.NewLine;
            l_strSQL += "clm_cLinkman," + Environment.NewLine;
            l_strSQL += "clm_cAddress," + Environment.NewLine;
            l_strSQL += "clm_cPhone," + Environment.NewLine;
            l_strSQL += "clm_cFax," + Environment.NewLine;
            l_strSQL += "clm_cWebSite," + Environment.NewLine;
            l_strSQL += "clm_cRemark," + Environment.NewLine;
            l_strSQL += "clm_cAdd," + Environment.NewLine;
            l_strSQL += "clm_dAddDate," + Environment.NewLine;
            l_strSQL += "clm_cLast," + Environment.NewLine;
            l_strSQL += "clm_dLastDate )" + Environment.NewLine;
            l_strSQL += " VALUES(";
            l_strSQL += "'" + infoObject.ClmCClientNum.Trim().Replace("'", "''") + "'";
            l_strSQL += ",'" + infoObject.ClmCEnglishName.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCChinaName.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCTaxNumber.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCLinkman.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCAddress.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCPhone.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCFax.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCWebSite.Replace("'", "''").Trim() + "'";
            l_strSQL += ",N'" + infoObject.ClmCRemark.Replace("'", "''").Trim() + "'";
            l_strSQL += ",'" + infoObject.ClmCAdd.Replace("'", "''").Trim() + "'";
            l_strSQL += ",GETDATE()";
            l_strSQL += ",'" + infoObject.ClmCLast.Replace("'", "''") + "'";
            l_strSQL += ",GETDATE())";

            DataAccessLayer dal = new DataAccessLayer();
            try
            {
                isSuccess = dal.ExecNonQuery(l_strSQL);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:53,代码来源:ClientMasterDA.cs


注:本文中的DataAccessLayer.ExecNonQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。