本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}