예제 #1
0
        private void FillGrid()
        {
            List <string> selectedCarrierNums = new List <string>();

            for (int i = 0; i < gridMain.SelectedIndices.Length; i++)
            {
                selectedCarrierNums.Add(table.Rows[gridMain.SelectedIndices[i]]["CarrierNum"].ToString());
            }
            //Carriers.Refresh();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            /*if(checkCDAnet.Checked){
             *      //gridMain.Size=new Size(745,gridMain.Height);
             *      col=new ODGridColumn(Lan.g("TableCarriers","Carrier Name"),160);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","EDI Code"),60);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","PMP"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","Network"),50);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","Version"),50);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","02"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","03"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","04"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","05"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","06"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","07"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","08"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             *      col=new ODGridColumn(Lan.g("TableCarriers","Hidden"),50,HorizontalAlignment.Center);
             *      gridMain.Columns.Add(col);
             * }
             * else{*/
            //gridMain.Size=new Size(839,gridMain.Height);
            col = new GridColumn(Lan.g("TableCarriers", "Carrier Name"), 160);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "Phone"), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "Address"), 130);
            gridMain.ListGridColumns.Add(col);
            //col=new ODGridColumn(Lan.g("TableCarriers","Address2"),120);
            //gridMain.Columns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "City"), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "ST"), 50);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "Zip"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "ElectID"), 50);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "Hidden"), 50, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableCarriers", "Plans"), 50);
            gridMain.ListGridColumns.Add(col);
            if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Canadian. en-CA or fr-CA
            {
                col = new GridColumn(Lan.g("TableCarriers", "CDAnet"), 50);
                gridMain.ListGridColumns.Add(col);
            }
            //}
            gridMain.ListGridRows.Clear();
            GridRow row;

            table = Carriers.GetBigList(checkCDAnet.Checked, checkShowHidden.Checked, textCarrier.Text, textPhone.Text);
            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new GridRow();

                /*if(checkCDAnet.Checked){
                 *      row.Cells.Add(table.Rows[i]["CarrierName"].ToString());
                 *      row.Cells.Add(table.Rows[i]["ElectID"].ToString());
                 *      row.Cells.Add(table.Rows[i]["pMP"].ToString());
                 *      row.Cells.Add(table.Rows[i]["network"].ToString());
                 *      row.Cells.Add(table.Rows[i]["version"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans02"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans03"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans04"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans05"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans06"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans07"].ToString());
                 *      row.Cells.Add(table.Rows[i]["trans08"].ToString());
                 *      row.Cells.Add(table.Rows[i]["isHidden"].ToString());
                 * }
                 * else{*/
                row.Cells.Add(table.Rows[i]["CarrierName"].ToString());
                row.Cells.Add(table.Rows[i]["Phone"].ToString());
                if (Programs.GetCur(ProgramName.DentalTekSmartOfficePhone).Enabled)
                {
                    row.Cells[row.Cells.Count - 1].ColorText = Color.Blue;
                    row.Cells[row.Cells.Count - 1].Underline = YN.Yes;
                }
                row.Cells.Add(table.Rows[i]["Address"].ToString());
                //row.Cells.Add(table.Rows[i]["Address2"].ToString());
                row.Cells.Add(table.Rows[i]["City"].ToString());
                row.Cells.Add(table.Rows[i]["State"].ToString());
                row.Cells.Add(table.Rows[i]["Zip"].ToString());
                row.Cells.Add(table.Rows[i]["ElectID"].ToString());
                row.Cells.Add(table.Rows[i]["isHidden"].ToString());
                row.Cells.Add(table.Rows[i]["insPlanCount"].ToString());
                if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                 //Canadian. en-CA or fr-CA
                {
                    row.Cells.Add(table.Rows[i]["isCDA"].ToString());
                }
                //}
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (selectedCarrierNums.Contains(table.Rows[i]["CarrierNum"].ToString()))
                {
                    gridMain.SetSelected(i, true);
                }
            }
            //if(tbCarriers.SelectedIndices.Length>0){
            //	tbCarriers.ScrollToLine(tbCarriers.SelectedIndices[0]);
            //}
        }