public DataTable GetObjectList(string aUser) { this.Cursor = Cursors.WaitCursor; DataTable dt = new DataTable(); if (this.cboObjectList.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.TABLE)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.TABLE); } else if (this.cboObjectList.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.VIEW)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.VIEW); } this.Cursor = Cursors.Default; return(dt); }
private void GetObjectList(string aUser = "") { this.Cursor = Cursors.WaitCursor; DataTable dt = new DataTable(); ListBox lbx = this.tabControl1.SelectedTab.Controls[0] as ListBox; lbx.Items.Clear(); if (string.IsNullOrEmpty(aUser)) { aUser = this.ucUserList1.User; } if (string.IsNullOrEmpty(this.txtSearch.Text)) { if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.TABLE)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.TABLE); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.VIEW)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.VIEW); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.FUNCTION)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.FUNCTION); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.PROCEDURE)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.PROCEDURE); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.TRIGGER)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.TRIGGER); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.INDEX)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.INDEX); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.SEQUENCE)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.SEQUENCE); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.PACKAGE)) { dt = DALDataAccess.GetObjectList(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.PACKAGE); } } else { if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.TABLE)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.TABLE, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.VIEW)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.VIEW, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.FUNCTION)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.FUNCTION, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.PROCEDURE)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.PROCEDURE, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.TRIGGER)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.TRIGGER, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.INDEX)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.INDEX, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.SEQUENCE)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.SEQUENCE, this.txtSearch.Text); } else if (this.tabControl1.SelectedTab.Text.Equals(Common.Definition.ConstValue.DBViewer_ObjectList_DISPLAY.PACKAGE)) { dt = DALDataAccess.GetObjectListByObjectName(aUser, Common.Definition.ConstValue.DBViewer_ObjectList_VALUE.PACKAGE, this.txtSearch.Text); } } foreach (DataRow dr in dt.Rows) { lbx.Items.Add(dr["OBJECT_NAME"].ToString()); } this.Cursor = Cursors.Default; }