本文整理汇总了C#中SQLDB.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# SQLDB.Delete方法的具体用法?C# SQLDB.Delete怎么用?C# SQLDB.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLDB
的用法示例。
在下文中一共展示了SQLDB.Delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DelProject
public bool DelProject(string projectno)
{
bool suc = false;
SQLDB _operator = new SQLDB("ICS_Project");
suc = _operator.Delete("ProjectNO='" + projectno + "'");
//if (suc)
//{
// Application["App_Mis_Company"] = CommonLib.GetCompany();
//}
return suc;
}
示例2: lnkbtn_saveStandardall_Click
protected void lnkbtn_saveStandardall_Click(object sender, EventArgs e)
{
SQLDB _operator = new SQLDB("VD_Info", "KPT");
string query = "select vdid from VD_Info group by vdid";
DataSet ds_allvd = _operator.SelectQuery(query);
for (int f = 10; f < ds_allvd.Tables[0].Rows.Count; f++)
{
int vsrdir2 = 2;
for (int k = 0; k < vsrdir2; k++)
{
DataSet dsCaledStd = new DataSet();
dsCaledStd = calStandard(ds_allvd.Tables[0].Rows[f]["vdid"].ToString(), k.ToString(), new DateTime(2014, 06, 09, 12, 0, 0), new DateTime(2014, 07, 09, 12, 0, 0));
if (dsCaledStd.Tables[0].Rows.Count > 0)
{
DataSet ds_standard = _operator.Select("", "", "VD_STANDARD");
DateTime updatetime = DateTime.Now;
DataSet ds_standardAdd = _operator.Select("1=0", "", "VD_STANDARD");
DataSet ds_standardAddHis = _operator.Select("1=0", "", "VD_STANDARD_HIS");
for (int i = 0; i < dsCaledStd.Tables[0].Rows.Count; i++)
{
DataRow dr = dsCaledStd.Tables[0].Rows[i];
string vdid = dr["vdid"].ToString();
string vsrdir = dr["vsrdir"].ToString();
string week = dr["week"].ToString();
string hours = dr["hours"].ToString();
DataRow[] dr_std = ds_standard.Tables[0].Select("Vdid = '" + vdid + "' AND Vsrdir = '" + vsrdir + "' AND Week = '" + week + "' AND Hours = '" + hours + "' ");
DataRow dr_add = ds_standardAdd.Tables[0].NewRow();
dr_add["Vdid"] = vdid;
dr_add["TypeName"] = "Default";
dr_add["Vsrdir"] = vsrdir;
dr_add["Hours"] = hours;
dr_add["Week"] = week;
dr_add["SpeedAvg"] = dr["SpeedAvg"].ToString();
dr_add["SpeedStandard"] = dr["SpeedStandard"].ToString();
dr_add["LaneOccupyAvg"] = dr["LaneOccupyAvg"].ToString();
dr_add["LaneOccupyStandard"] = dr["LaneOccupyStandard"].ToString();
dr_add["FlowAvg"] = dr["FlowAvg"].ToString();
dr_add["FlowStandard"] = dr["FlowStandard"].ToString();
dr_add["Times"] = 2;
dr_add["UpdateTime"] = updatetime;
ds_standardAdd.Tables[0].Rows.Add(dr_add);
//將有衝突的標準型態備份到VD_STANDARD_HIS
if (dr_std.Length > 0)
{
DataRow dr_addhis = ds_standardAddHis.Tables[0].NewRow();
dr_addhis["StandardNum"] = dr_std[0]["StandardNum"];
dr_addhis["Vdid"] = vdid;
dr_addhis["TypeName"] = "Default";
dr_addhis["Vsrdir"] = vsrdir;
dr_addhis["Hours"] = hours;
dr_addhis["Week"] = week;
dr_addhis["SpeedAvg"] = dr_std[0]["SpeedAvg"].ToString();
dr_addhis["SpeedStandard"] = dr_std[0]["SpeedStandard"].ToString();
dr_addhis["LaneOccupyAvg"] = dr_std[0]["LaneOccupyAvg"].ToString();
dr_addhis["LaneOccupyStandard"] = dr_std[0]["LaneOccupyStandard"].ToString();
dr_addhis["FlowAvg"] = dr_std[0]["FlowAvg"].ToString();
dr_addhis["FlowStandard"] = dr["FlowStandard"].ToString();
dr_addhis["Times"] = 2;
dr_addhis["UpdateTime"] = updatetime;
ds_standardAddHis.Tables[0].Rows.Add(dr_addhis);
dr_std[0].Delete();
}
}
DataSet DSChange = ds_standard.GetChanges(DataRowState.Deleted);
if (DSChange != null)
{
if (_operator.Delete(DSChange))
{
// ShowMsg(UpdatePanel1, "資料刪除成功");
}
}
DataSet DSChangeAdd = ds_standardAdd.GetChanges();
DataSet DSChangeAddHis = ds_standardAddHis.GetChanges();
bool suc = false;
if (DSChangeAdd != null)
{
if (_operator.Insert(DSChangeAdd))
{
suc = true;
}
}
if (DSChangeAddHis != null)
{
if (_operator.Insert(DSChangeAdd))
{
suc = true;
}
}
//if (suc)
//{
// ShowMsg(UpdatePanel2, "建立成功");
//}
//.........这里部分代码省略.........
示例3: DelWarrantyNotify
public bool DelWarrantyNotify(string caseid)
{
SQLDB contract = new SQLDB("WarrantyNotify");
bool suc = false;
suc = contract.Delete("CaseID = '" + caseid + "'");
//if (suc)
//{
// Application["App_Mis_Region"] = CommonLib.GetRegion();
//}
return suc;
}
示例4: DelDevieKind
public bool DelDevieKind(string DevieKindid)
{
SQLDB contract = new SQLDB("DeviceKind");
bool suc = false;
suc = contract.Delete("DeviceKindId = '" + DevieKindid + "'");
//if (suc)
//{
// Application["App_Mis_Region"] = CommonLib.GetRegion();
//}
return suc;
}
示例5: DelRegion
public bool DelRegion(string AreaID)
{
SQLDB contract = new SQLDB("Area_Data");
bool suc = false;
suc = contract.Delete("AreaID = '" + AreaID + "'");
if (suc)
{
Application["App_Mis_Region"] = CommonLib.GetRegion();
}
return suc;
}
示例6: DelContract
public bool DelContract(string contractId)
{
SQLDB contract = new SQLDB("Contract");
bool suc = false;
suc = contract.Delete("contractId = '" + contractId + "'");
//return _operator.Delete(" Company_ID = " + Convert.ToInt32(companyid));
if (suc)
{
Application["App_Mis_Contract"] = CommonLib.GetContract();
}
return suc;
}