public void Delete(string sRoleID) { ArrayList aList = new ArrayList(); string sSQL = DeleteRole(sRoleID); aList.Add(sSQL); //sSQL = DeleteUser(sRoleID); //aList.Add(sSQL); clsSQL.ExecSqlTran(aList); }
private void btnSave() { int iRow = 0; if (gridView2.RowCount < 1) { iRow = 0; } else { iRow = gridView2.FocusedRowHandle; } string sAccID = gridView2.GetRowCellValue(iRow, gridColumn3).ToString().Trim(); ArrayList aList = new ArrayList(); string sSQL = "delete dbo._UserUFAcc where vchrUFAcc = '" + sAccID + "'"; aList.Add(sSQL); for (int i = 0; i < gridView1.RowCount; i++) { if (gridView1.GetRowCellValue(i, gridColumn1).ToString().Trim() == "√") { sSQL = "insert into _UserUFAcc(vchrUserID,vchrUFAcc)values('" + gridView1.GetRowCellValue(i, colvchrUid).ToString().Trim() + "','" + sAccID + "')"; aList.Add(sSQL); } } clsSQL.ExecSqlTran(aList); GetUserInfo(sAccID); }
private void btnDel() { sState = "del"; string sSQL = ""; ArrayList aList = new ArrayList(); if (txtfchrFrmNameID.Text.Trim() == string.Empty) { throw new Exception("窗体编号不能为空!"); } sSQL = "delete dbo._FormBtnInfo where fchrFrmNameID='" + txtfchrFrmNameID.Text.ToString().Trim() + "'"; aList.Add(sSQL); sSQL = "delete dbo._Form where fchrFrmNameID = '" + txtfchrFrmNameID.Text.ToString().Trim() + "'"; aList.Add(sSQL); clsSQL.ExecSqlTran(aList); }
public void AddSQL(string sPK, DataTable dt) { string sSQL = ""; ArrayList arrList = new ArrayList(); sSQL = "delete dbo._RoleRight " + "where vchrRoleID = '" + sPK + "' "; arrList.Add(sSQL); for (int i = 0; i < dt.Rows.Count; i++) { sSQL = AddRoleRight(sPK, dt.Rows[i]); arrList.Add(sSQL); } clsSQL.ExecSqlTran(arrList); }
private void btnSave() { try { int iSystem = 0; if (chkSystem.Checked) { iSystem = 1; } ArrayList aList = new ArrayList(); string sSQL = "delete _TableColInfo where TABLE_CATALOG = '" + lookUpEditDataBase.EditValue.ToString().Trim() + "' and TABLE_NAME = '" + lookUpEditTable.EditValue.ToString().Trim() + "'"; aList.Add(sSQL); gridView1.FocusedRowHandle -= 1; gridView1.FocusedRowHandle += 1; DataTable dt = (DataTable)gridControl1.DataSource; for (int i = 0; i < dt.Rows.Count; i++) { int iKey = 0; if (Convert.ToBoolean(dt.Rows[i]["bKey"])) { iKey = 1; } sSQL = "insert into dbo._TableColInfo(bSystem,TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,COLUMN_Text,DATA_TYPE,COLLATION_ADD,bKey) " + "values(" + iSystem + ",'" + dt.Rows[i]["TABLE_CATALOG"] + "','dbo','" + dt.Rows[i]["TABLE_NAME"] + "','" + dt.Rows[i]["COLUMN_NAME"] + "','" + dt.Rows[i]["COLUMN_Text"] + "'," + dt.Rows[i]["DataType"] + "," + dt.Rows[i]["collation_add"] + "," + iKey + ")"; aList.Add(sSQL); } if (aList.Count <= 0) { throw new Exception("保存失败!"); } clsSQL.ExecSqlTran(aList); MessageBox.Show("保存成功,共计:" + aList.Count); lookUpEditTable_EditValueChanged(null, null); } catch (Exception ee) { MessageBox.Show("保存失败!\n " + ee.Message); } }