private void mdCashVoucherInit() { fMode = "N"; string strSQL; //strSQL = "select * from tblServiceType"; //comboBind(mdSV_cbNServiceTypeID,strSQL,"strDescription","nServiceTypeID",true); DataTable dt; DataSet _ds; _ds = new DataSet(); strSQL = "select * from tblCashVoucherType"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); dt = _ds.Tables["Table"]; DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[2]; col[0] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("nCashVoucherTypeID", "Cash Voucher Type", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None); col[1] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strCashVoucherType", "Description", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None); myManager = new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(repositoryItemLookUpEdit1, dt, col, "strCashVoucherType", "nCashVoucherTypeID", "Manager"); _ds = new DataSet(); strSQL = "select strBranchCode from tblBranch"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "table" }, new SqlParameter("@strSQL", strSQL)); dt = _ds.Tables["table"]; DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col2 = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[1]; col2[0] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strBranchCode", "Branch Code", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None); new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(lk_BranchCode, dt, col2, "strBranchCode", "strBranchCode", "Branch Code"); strSQL = "select * from tblCashVoucher "; strSQL += " where (strSN like '%" + txtSearch.Text + "%' or strSN like '%" + txtSearch.Text + "%')"; _ds = new DataSet(); SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "table" }, new SqlParameter("@strSQL", strSQL)); dtCashVoucher = _ds.Tables["table"]; this.gridControlMd_CashVoucher.DataSource = dtCashVoucher; }
private void mdInstructorTypeCommissionInit() { DataTable dt; DataSet _ds; _ds = new DataSet(); string strSQL = "select * from tblInstructorCommission"; SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); dt = _ds.Tables["Table"]; DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[2]; col[0] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("nCommissionTypeID","Commission Type ID",15,DevExpress.Utils.FormatType.None,"",true,DevExpress.Utils.HorzAlignment.Default,DevExpress.Data.ColumnSortOrder.None); col[1] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strDescription","Description",15,DevExpress.Utils.FormatType.None,"",true,DevExpress.Utils.HorzAlignment.Default,DevExpress.Data.ColumnSortOrder.None); myManager = new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(repositoryItemLookUpEdit2,dt,col,"strDescription","nCommissionTypeID","Manager"); _ds = new DataSet(); strSQL = "select * from tblInstructorType"; SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); dt = _ds.Tables["Table"]; DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col1 = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[2]; col1[0] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("nInstructorTypeID","Instructor Type ID",15,DevExpress.Utils.FormatType.None,"",true,DevExpress.Utils.HorzAlignment.Default,DevExpress.Data.ColumnSortOrder.None); col1[1] = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strDescription","Description",15,DevExpress.Utils.FormatType.None,"",true,DevExpress.Utils.HorzAlignment.Default,DevExpress.Data.ColumnSortOrder.None); myManager = new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(repositoryItemLookUpEdit1,dt,col1,"strDescription","nInstructorTypeID","Manager"); strSQL = "select A.*,B.strDescription as strITDescription, C.strDescription as strCommDescription from tblInstructorTypeCommission A join tblInstructorType B on A.nInstructorTypeID=B.nInstructorTypeID join tblInstructorCommission C on A.nCommissionTypeID=C.nCommissionTypeID"; _ds = new DataSet(); SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"table"}, new SqlParameter("@strSQL", strSQL) ); dtInstructorCommission=_ds.Tables["table"]; gridControlMd_InstructorTypeCommission.DataSource = dtInstructorCommission; }