void BindPayDayCode()
        {
            PayDayCodeManager oManager = new PayDayCodeManager();
            DataTable dtLines = new DataTable();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            dtLines = oManager.GetPayDayCodeHeader();

            cboPayDayCode.Properties.DataSource = dtLines;
            cboPayDayCode.Properties.DisplayMember = "Remarks";
            cboPayDayCode.Properties.ValueMember = "PayDayCode";

            DevExpress.XtraEditors.Controls.LookUpColumnInfo col;

            col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("PayDayCode", "Code", 100);
            cboPayDayCode.Properties.Columns.Add(col);
            col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Remarks", "Name", 100);

            cboPayDayCode.Properties.Columns.Add(col);
            cboPayDayCode.Refresh();

            oManager.Close();
        }
示例#2
0
        private void BindPayDayCode()
        {
            PayDayCodeManager oManager = new PayDayCodeManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dtHeader = oManager.GetPayDayCodeHeader();
            DataTable dtLineItems = oManager.GetPayDayCodeLineItems();

            DataSet dsPayDayCode = new DataSet();

            dsPayDayCode.Tables.Add(dtHeader);
            dsPayDayCode.Tables.Add(dtLineItems);

            DataColumn keyColumn = dsPayDayCode.Tables[0].Columns["PayDayCode"];
            DataColumn foreignKeyColumn = dsPayDayCode.Tables[1].Columns["PayDayCode"];
            dsPayDayCode.Relations.Add("PayDayCode", keyColumn, foreignKeyColumn);

            //Bind the grid control to the data source
            gridControl1.DataSource = dsPayDayCode.Tables[0];

            gridControl1.Refresh();
        }