public void ExportToTxt(DataView dv) { string fn = "bf" + Common.ChineseToSpell.GetChineseSpell(cmbLb.SelectedValue.ToString()).ToLower();//此处把值转换为拼音 SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = "txt(*.txt)|*.txt"; saveFileDialog1.FilterIndex = 0; saveFileDialog1.RestoreDirectory = true; saveFileDialog1.CreatePrompt = true; saveFileDialog1.Title = "导出txt文件到 "; DateTime now = DateTime.Now; saveFileDialog1.FileName = fn; saveFileDialog1.ShowDialog(); Stream myStream; myStream = saveFileDialog1.OpenFile(); StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312")); for (int rowNo = 0; rowNo < dv.Count; rowNo++) { String tempstr = ""; for (int columnNo = 0; columnNo < dv.Table.Columns.Count; columnNo++) { if (columnNo > 0) { tempstr += "\t "; } tempstr += dv.Table.Rows[rowNo][columnNo].ToString(); } sw.WriteLine(tempstr); } sw.Close(); myStream.Close(); }
public void Check_XmlFile() { filename = ConfigurationManager.AppSettings["XMLFile"]; if (filename == null) { MessageBox.Show("XML-tiedosto tai tiedoston polku on virheellinen.."); } else { try { set.ReadXml(filename); ComboCountry.Items.Add(""); dv = set.Tables[0].DefaultView; foreach (DataRowView Rows in dv) { string continent = Rows.Row.Field<string>("Continent"); if (!ComboCountry.Items.Contains(continent)) { ComboCountry.Items.Add(continent); } } dg_View.ItemsSource = set.Tables[0].DefaultView; } catch (Exception ex) { MessageBox.Show("Virhe XML-Tiedoston lukemisessa: " + ex.Message); } } }
public override void Run(ServiceController[] services, Form mainForm, DataGrid serviceGrid) { var addedMachine = QuickDialog2.DoQuickDialog("Add A Machine's Services", "Machine Name:",".","Pattern ^(Enable|EPX):",""); if (addedMachine != null) { MachineName = addedMachine[0]; this.SearchPattern = addedMachine[1]; try { DataGrid dgrid = serviceGrid; this.addView = (DataView)dgrid.DataSource; CurrencyManager bm = (CurrencyManager)dgrid.BindingContext[this.addView]; ArrayList arrSelectedRows = new ArrayList(); this.addView = (DataView)bm.List; mainForm.Invoke(new InvokeDelegate(this.AddMachineInGUIThread)); serviceGrid.Refresh(); } finally { addedMachine = null; addView = null; } } }
public void InitializeMemberData() { DataSet ds = EmployeeDA.SelectDS(); DataView dv = new DataView(ds.Tables[0]); dataGridView1.DataSource = dv; dataGridView1.Enabled = true; textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; textBox4.Enabled = false; textBox6.Enabled = false; textBox7.Enabled = false; comboBox1.Enabled = false; button1.Visible = true; button2.Visible = true; button3.Visible = true; button8.Visible = false; button9.Visible = false; button10.Visible = false; textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox6.Clear(); textBox7.Clear(); comboBox1.Text = ""; }
public AdminGUI() { InitializeComponent(); SelectDA.getComboBox(comboBox2, "SELECT * FROM Suppliers ORDER BY CompanyName"); DataSet ds = SelectDA.SelectDS("SELECT ProductID,ProductName,CompanyName,UnitPrice FROM Products,Suppliers WHERE Products.SupplierID = Suppliers.SupplierID"); DataView dv = new DataView(ds.Tables[0]); dataGridView3.DataSource = dv; textBox10.Enabled = false; textBox9.Enabled = false; comboBox2.Enabled = false; textBox8.Enabled = false; button8.Visible = false; textBox6.Visible = false; textBox7.Visible = false; label7.Visible = false; label8.Visible = false; button9.Visible = false; button10.Visible = false; EnableTextBox(false); ClearTextBox(); cbTypeSearch.SelectedIndex = 1; showData(""); InitializeMemberData(); }
/// <summary> /// 菜单树列表 /// </summary> public void GetMenuTreeTable() { DataTable dtList = system_idao.GetMenuBind(); DataTable dtRoleRight = system_idao.InitRoleRight(_key); if (DataTableHelper.IsExistRows(dtList)) { DataTable dtButoon = DataTableHelper.GetNewDataTable(dtList, "Menu_Type = '3'"); DataTable dtMenu = DataTableHelper.GetNewDataTable(dtList, "Menu_Type < '3'"); DataView dv = new DataView(dtMenu); dv.RowFilter = " ParentId = '0'"; int eRowIndex = 0; foreach (DataRowView drv in dv) { string trID = "node-" + eRowIndex.ToString(); StrTree_Menu.Append("<tr id='" + trID + "'>"); StrTree_Menu.Append("<td style='width: 200px;padding-left:20px;'><span class=\"folder\">" + drv["Menu_Name"] + "</span></td>"); if (!string.IsNullOrEmpty(drv["Menu_Img"].ToString())) StrTree_Menu.Append("<td style='width: 30px;text-align:center;'><img src='/Themes/images/32/" + drv["Menu_Img"] + "' style='width:16px; height:16px;vertical-align: middle;' alt=''/></td>"); else StrTree_Menu.Append("<td style='width: 30px;text-align:center;'><img src='/Themes/images/32/5005_flag.png' style='width:16px; height:16px;vertical-align: middle;' alt=''/></td>"); StrTree_Menu.Append("<td style=\"width: 23px; text-align: left;\"><input id='ckb" + trID + "' onclick=\"ckbValueObj(this.id)\" style='vertical-align: middle;margin-bottom:2px;' type=\"checkbox\" " + GetChecked(drv["Menu_Id"].ToString(), dtRoleRight) + " value=\"" + drv["Menu_Id"] + "\" name=\"checkbox\" /></td>"); StrTree_Menu.Append("<td>" + GetButton(drv["Menu_Id"].ToString(), dtButoon, trID, dtRoleRight) + "</td>"); StrTree_Menu.Append("</tr>"); //创建子节点 StrTree_Menu.Append(GetTableTreeNode(drv["Menu_Id"].ToString(), dtMenu, trID, dtButoon, dtRoleRight)); eRowIndex++; } } }
public void GetMenuTreeTable() { DataTable dtMenu = this.systemidao.GetMenuList(); DataView dv = new DataView(dtMenu); dv.RowFilter = " ParentId = '0'"; int eRowIndex = 0; foreach (DataRowView drv in dv) { string trID = "node-" + eRowIndex.ToString(); this.TableTree_Menu.Append("<tr id='" + trID + "'>"); this.TableTree_Menu.Append("<td style='width: 230px;padding-left:20px;'><span class=\"folder\">" + drv["Menu_Name"].ToString() + "</span></td>"); if (!string.IsNullOrEmpty(drv["Menu_Img"].ToString())) { this.TableTree_Menu.Append("<td style='width: 30px;text-align:center;'><img src='../../Themes/images/32/" + drv["Menu_Img"].ToString() + "' style='width:16px; height:16px;vertical-align: middle;' alt=''/></td>"); } else { this.TableTree_Menu.Append("<td style='width: 30px;text-align:center;'><img src='../../Themes/images/32/5005_flag.png' style='width:16px; height:16px;vertical-align: middle;' alt=''/></td>"); } this.TableTree_Menu.Append("<td style='width: 60px;text-align:center;'>" + this.GetMenu_Type(drv["Menu_Type"].ToString()) + "</td>"); this.TableTree_Menu.Append("<td style='width: 60px;text-align:center;'>" + drv["Target"].ToString() + "</td>"); this.TableTree_Menu.Append("<td style='width: 60px;text-align:center;'>" + drv["Sort"].ToString() + "</td>"); this.TableTree_Menu.Append("<td>" + drv["NavigateUrl"].ToString() + "</td>"); this.TableTree_Menu.Append("<td style='display:none'>" + drv["Menu_Id"].ToString() + "</td>"); this.TableTree_Menu.Append("</tr>"); this.TableTree_Menu.Append(this.GetTableTreeNode(drv["Menu_Id"].ToString(), dtMenu, trID)); eRowIndex++; } }
//private int len = 2; public void RootNode(TreeNode pNode) { if (ds == null) return; DataView dvTree = new DataView(ds.Tables[0]); //dvTree.RowFilter = "len(Code)=" + len.ToString(); dvTree.RowFilter = "Parent_Code=0";//Rank=1"; foreach (DataRowView Row in dvTree) { TreeNode Node = this.Nodes.Add(Row["Code"].ToString(), "[" + Row["Code"].ToString() + "]" + Row["Name"].ToString(), 1); //AddNode(Node, len); AddNode(Node); } this.ExpandAll(); if (m_SelectName.Trim() == "") return; foreach (TreeNode nt in this.Nodes) { if (nt.Name == SelectStringByLen(2)) { this.SelectedNode = nt; if (m_SelectName.Length > 2) Select(nt); return; } } }
[Test] public void CancelEdit() { DataTable dt = DataProvider.CreateParentDataTable(); DataView dv = new DataView(dt); DataRowView drv = dv[0]; drv.BeginEdit(); drv["String1"] = "ChangeValue"; // check Proposed value Assert.AreEqual("ChangeValue" , dt.Rows[0]["String1",DataRowVersion.Proposed] , "DRV5"); // check IsEdit Assert.AreEqual(true, drv.IsEdit , "DRV6"); // check Proposed value drv.CancelEdit(); Assert.AreEqual(false, dt.Rows[0].HasVersion(DataRowVersion.Proposed) , "DRV7"); // check current value Assert.AreEqual("1-String1" , dt.Rows[0]["String1",DataRowVersion.Current ] , "DRV8"); // check IsEdit after cancel edit Assert.AreEqual(false, drv.IsEdit , "DRV9"); }
private void frmVentasPesosInter_Load(object sender, EventArgs e) { this.Location = new Point(50, 50); System.Drawing.Icon ico = Properties.Resources.icono_app; this.Icon = ico; this.ControlBox = true; this.MaximizeBox = false; FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; DataTable tblLocales = BL.GetDataBLL.Locales(); DataTable tblFormasPago = BL.GetDataBLL.FormasPago(); DataView viewLocales = new DataView(tblLocales); viewLocales = new DataView(tblLocales); viewLocales.RowFilter = "IdLocalLOC <>'2' AND IdLocalLOC <>'1'"; lstLocales.DataSource = viewLocales; lstLocales.DisplayMember = "NombreLOC"; lstLocales.ValueMember = "IdLocalLOC"; tblFormasPago = BL.GetDataBLL.FormasPago(); cmbForma.ValueMember = "IdFormaPagoFOR"; cmbForma.DisplayMember = "DescripcionFOR"; cmbForma.DropDownStyle = ComboBoxStyle.DropDown; cmbForma.DataSource = tblFormasPago; cmbForma.SelectedValue = -1; cmbForma.BackColor = Color.White; AutoCompleteStringCollection formasPagoColection = new AutoCompleteStringCollection(); foreach (DataRow row in tblFormasPago.Rows) { formasPagoColection.Add(Convert.ToString(row["DescripcionFOR"])); } cmbForma.AutoCompleteCustomSource = formasPagoColection; cmbForma.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbForma.AutoCompleteSource = AutoCompleteSource.CustomSource; cmbForma.SelectedValue = 99; lstLocales.SelectionMode = SelectionMode.One; lstLocales.SelectedIndex = -1; }
public override void EgyediEgyszeruInit() { EgyszeruTabla = new DataTable("PARTNER"); Sqlinterface.Select(EgyszeruTabla, FakUserInterface.AktualCegconn, "PARTNER", "", " order by SZOVEG ", false); for (int i = 0; i < EgyszeruTabla.Rows.Count; i++) { DataRow egyrow = EgyszeruTabla.Rows[i]; if (egyrow.RowState != DataRowState.Deleted) { bool van = false; for (int j = 0; j < partneridk.Length; j++) { if (egyrow["PARTNER_ID"].ToString() == partneridk[j]) { van = true; break; } } if (!van) egyrow.Delete(); } } EgyszeruTablaView = new DataView(EgyszeruTabla); EgyszeruIdNev = "PARTNER_ID"; EgyszeruMegnevColumnNev = "SZOVEG"; }
public void initTrvTree(TreeNodeCollection treeNodes, string strParentIndex, DataView dvList) { try { TreeNode tempNode; DataView dvList1; string currentNum; dvList1 = dvList; // select the datarow that it's parentcode is strParentIndex DataRow[] dataRows = dvList.Table.Select("parentCode ='" + strParentIndex + "'"); foreach (DataRow dr in dataRows) { tempNode = new TreeNode(); tempNode.Text = dr["bookTypeCode"].ToString() + "-" + dr["bookTypeName"].ToString(); // tag property is save data about this treenode tempNode.Tag = new treeNodeData(dr["bookTypeCode"].ToString(), dr["bookTypeName"].ToString(), dr["bookTypeExplain"].ToString(), dr["currentCode"].ToString(), dr["parentCode"].ToString()); currentNum = dr["currentCode"].ToString(); treeNodes.Add(tempNode); // call rucursive TreeNodeCollection temp_nodes = treeNodes[treeNodes.Count - 1].Nodes; initTrvTree(temp_nodes, currentNum, dvList1); } } catch (Exception) { MessageBox.Show("初始化TreeView失败"); } }
private void chartServiceTestNumber_Load(object sender, EventArgs e) { chart1.Series["Series2"].Points.Clear(); GetSummary(); DataView dv = new DataView(_dataSet.Tables[0]); foreach (DataRowView rowView in dv) { DataRow row = rowView.Row; _total = _total + (decimal)row["NoofTest"]; } for (int i=0;i<dv.Count;i++) { decimal percentage= decimal.Round(((decimal)dv[i]["NoofTest"]), 4, MidpointRounding.AwayFromZero); dv[i]["percentage"] = percentage; } chart1.Series["Series2"].LegendText ="#VALX , #VALY , (#PERCENT)"; chart1.Series["Series2"].Points.DataBindXY(dv, "AreaName", dv, "percentage"); chart1.Series["Series2"].IsValueShownAsLabel = false; chart1.Series["Series2"]["PieLabelStyle"] = "Disabled"; chart1.Titles[0].Text = _chartTitle; }
private void ArrayBinding_Load(object sender, System.EventArgs e) { // Access database System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm mainForm = (System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm)this.ParentForm; // The XML document string fileNameString = mainForm.applicationPath + "\\data\\data.xml"; string fileNameSchema = mainForm.applicationPath + "\\data\\data.xsd"; // Initializes a new instance of the DataSet class DataSet custDS = new DataSet(); // Reads an XML schema into the DataSet. custDS.ReadXmlSchema( fileNameSchema ); // Reads XML schema and data into the DataSet. custDS.ReadXml( fileNameString ); // Initializes a new instance of the DataView class DataView firstView = new DataView(custDS.Tables[0]); Chart1.Series.Clear(); // Since the DataView implements and IEnumerable, pass the reader directly into // the DataBindTable method with the name of the column used for the X value. Chart1.DataBindTable(firstView, "Name"); // Set series appearance Chart1.Series[0].ChartType = SeriesChartType.Bar; Chart1.Series[0].Font = new Font("Trebuchet MS", 8); Chart1.Series[0].Color = System.Drawing.Color.FromArgb(220, 224,64,10); Chart1.Series[0].BorderWidth = 0; }
public void AddNewTest () { DataView dv = new DataView (dt); IBindingList ib = (IBindingList) dv; ib.ListChanged += new ListChangedEventHandler (OnListChanged); try { args = null; object o = ib.AddNew (); Assert.AreEqual (typeof (DataRowView), o.GetType (), "#1"); Assert.AreEqual (ListChangedType.ItemAdded, args.ListChangedType, "#1.1"); Assert.AreEqual (4, args.NewIndex, "#1.2"); Assert.AreEqual (-1, args.OldIndex, "#1.3"); DataRowView r = (DataRowView) o; Assert.AreEqual (25, r ["id"], "#2"); Assert.AreEqual (DBNull.Value, r ["name"], "#3"); Assert.AreEqual (5, dv.Count, "#4"); args = null; r.CancelEdit (); Assert.AreEqual (ListChangedType.ItemDeleted, args.ListChangedType, "#4.1"); Assert.AreEqual (4, args.NewIndex, "#4.2"); Assert.AreEqual (-1, args.OldIndex, "#4.3"); Assert.AreEqual (4, dv.Count, "#5"); } finally { ib.ListChanged -= new ListChangedEventHandler (OnListChanged); } }
public void GetReady () { dataTable = new DataTable ("itemTable"); dc1 = new DataColumn ("itemId"); dc2 = new DataColumn ("itemName"); dc3 = new DataColumn ("itemPrice"); dc4 = new DataColumn ("itemCategory"); dataTable.Columns.Add (dc1); dataTable.Columns.Add (dc2); dataTable.Columns.Add (dc3); dataTable.Columns.Add (dc4); DataRow dr; seed = 123; rowCount = 5; rndm = new Random (seed); for (int i = 1; i <= rowCount; i++) { dr = dataTable.NewRow (); dr["itemId"] = "item " + i; dr["itemName"] = "name " + rndm.Next (); dr["itemPrice"] = "Rs. " + (rndm.Next () % 1000); dr["itemCategory"] = "Cat " + ((rndm.Next () % 10) + 1); dataTable.Rows.Add (dr); } dataTable.AcceptChanges (); dataView = new DataView (dataTable); dataView.ListChanged += new ListChangedEventHandler (OnListChanged); listChangedArgs = null; }
private void btBorrow_Click(object sender, EventArgs e) { DateTime brDate; DateTime dueDate; int brNumber = int.Parse(tbMemberCode.Text.ToString()); int copyNumber = int.Parse(tbCopyNumber.Text.ToString()); try { //brDate = DateTime.Parse(tbBorrowedDate.Text.ToString()); brDate = Utility.getReturnedDate(tbBorrowedDate.Text); dueDate = brDate.AddDays(14); CirculatedCopy c = new CirculatedCopy(copyNumber, brNumber, dueDate); if (CirculatedCopyBL.insert(c)) { CopyBL.setTypeOfCopyNumber(copyNumber, 'B'); int bookNumber = CopyBL.getBookNumber(copyNumber); ReserveBL.setStatusOfReservation(brNumber, bookNumber, 'A'); tbBorrowedDate.Enabled = false; tbCopyNumber.Enabled = false; btBorrow.Enabled = false ; tbMemberCode.Enabled = true; btCheckMember.Enabled = true; tbDueDate.Text = dueDate.ToShortDateString(); MessageBox.Show("Borrow successful!"); } DataSet ds = CirculatedCopyBL.selectDs(); DataView dv = new DataView(ds.Tables[0]); dv.RowFilter = "returnedDate is NULL and borrowerNumber=" + brNumber; labelBorrowBorrowedBook.Text = dv.Count.ToString(); dgvBorrowed.DataSource = dv; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void UpdateFiltter() { try { string filu = @fileUrl; DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataView dv = new DataView(); ds.ReadXml(filu); dt = ds.Tables[0]; dv = dt.DefaultView; if (cbFiltter.SelectedIndex != -1 && cbFiltter.SelectedIndex != 0) { dt.DefaultView.RowFilter = "maa = '" + cbFiltter.SelectedItem.ToString() + "'"; } dgWines.ItemsSource = dv; } catch (Exception ex) { throw; } }
private static List<CedEntidades.Usuario> ArmarLista(DataView DV, CedEntidades.Sesion Sesion) { List<CedEntidades.Usuario> usuarioLista = new List<CedEntidades.Usuario>(); for (int i = 0; i < DV.Table.Rows.Count; i++) { CedEntidades.Usuario u = new CedEntidades.Usuario(); u.IdUsuario = Convert.ToString(DV.Table.Rows[i]["IdUsuario"]); u.Nombre = Convert.ToString(DV.Table.Rows[i]["Nombre"]); u.Activo = Convert.ToBoolean(DV.Table.Rows[i]["Activo"]); if (DV.Table.Rows[i]["Alias"] != System.DBNull.Value) { u.Alias = Convert.ToString(DV.Table.Rows[i]["Alias"]); } else { u.Alias = String.Empty; } u.FecAlta = Convert.ToDateTime(DV.Table.Rows[i]["FecAlta"]); u.FecBaja = Convert.ToDateTime(DV.Table.Rows[i]["FecBaja"]); if (DV.Table.Rows[i]["Email"] != System.DBNull.Value) { u.Email = Convert.ToString(DV.Table.Rows[0]["Email"]); } else { u.Email = String.Empty; } usuarioLista.Add(u); } return usuarioLista; }
public DataTable ObtenerCentroCosto(String CLASE) { Conexion conexion = new Conexion(Empresa); DataSet _dataSet = new DataSet(); DataView _dataView = new DataView(); DataTable _dataTable = new DataTable(); String sql = null; sql = "usp_ObtenerCentroCosto "; try { _dataSet = conexion.ExecuteReader(sql); _dataView = _dataSet.Tables[0].DefaultView; _dataTable = _dataView.Table; } catch (Exception e) { MensajeError = e.Message; } finally { conexion.Desconectar(); } return _dataTable; }
[Test] public void AddNew() { //create the source datatable DataTable dt = DataProvider.CreateChildDataTable(); //create the dataview for the table DataView dv = new DataView(dt); int CountView = dv.Count ; int CountTable= dt.Rows.Count ; DataRowView drv = null; // AddNew - DataView Row Count drv = dv.AddNew(); Assert.AreEqual(dv.Count , CountView+1, "DV1"); // AddNew - Table Row Count Assert.AreEqual(dt.Rows.Count , CountTable, "DV2"); // AddNew - new row in DataTable drv.EndEdit(); Assert.AreEqual(dt.Rows.Count , CountTable+1, "DV3"); // AddNew - new row != null Assert.AreEqual(true, drv!=null, "DV4"); // AddNew - check table Assert.AreEqual(dt, drv.Row.Table, "DV5"); }
public DataSet LoadPCB(string file, System.Windows.Forms.DataGridView dg) { dt.Clear(); try { dscomponents.Tables.RemoveAt(0); } catch { } try { dscomponents.Tables.RemoveAt(1); } catch { } FileStream finschema = new FileStream(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\board.xsd", FileMode.Open, FileAccess.Read, FileShare.Read); dscomponents.ReadXmlSchema(finschema); finschema.Close(); FileStream findata = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); dscomponents.ReadXml(findata); findata.Close(); DataView dvTable = new DataView(dscomponents.Tables["Component"]); dvTable.Sort = "feederNumber ASC"; dg.DataSource = dvTable; for (int i = 0; i < dg.Rows.Count; i++) { dg.Rows[i].Cells["Pick"].Value = true; } return dscomponents; }
public String GetWhereClause(DataView view, bool isLinq) { //String text = isLinq ? " && " : " AND "; //new Hashtable(); //String text2 = String.Empty; //foreach (JQGridColumn column in this._grid.Columns) //{ // String text3 = this._grid.Page.Request[column.DataField]; // if (!String.IsNullOrEmpty(text3)) // { // JQGridSearchEventArgs args2 = new JQGridSearchEventArgs(); // args2.SearchColumn = column.DataField; // args2.SearchString = text3; // args2.SearchOperation = column.SearchToolBarOperation; // JQGridSearchEventArgs e = args2; // String text4 = (text2.Length > 0) ? text : ""; // String text5 = isLinq ? this.ConstructLinqFilterExpression(view, e) : this.ConstructFilterExpression(view, e); // text2 = text2 + text4 + text5; // } //} //return text2; return String.Empty; }
protected void LoadData() { db dbc = new db(); string query = "SELECT * FROM pages ORDER BY id DESC"; dbc.cmd.CommandText = query; SqlDataAdapter da = new SqlDataAdapter(dbc.cmd); DataTable dt = new DataTable(); da.Fill(dt); PagedDataSource pgitems = new PagedDataSource(); DataView dv = new DataView(dt); pgitems.DataSource = dv; pgitems.AllowPaging = true; pgitems.PageSize = 9; pgitems.CurrentPageIndex = PageNumber; if (pgitems.PageCount > 1) { rptPages.Visible = true; ArrayList pages = new ArrayList(); for (int i = 0; i < pgitems.PageCount; i++) pages.Add((i + 1).ToString()); rptPages.DataSource = pages; rptPages.DataBind(); } else rptPages.Visible = false; rptContent.DataSource = pgitems; rptContent.DataBind(); }
protected void gridsent_RowCommand(object sender, GridViewCommandEventArgs e) { int index = 0; String editButton = Request.Params.Get("__EVENTARGUMENT"); if (editButton != null && editButton.Contains("select")) { string aplicate = editButton.Substring(6, 4); if (aplicate != null && aplicate == "dell") { index = Convert.ToInt32(editButton.Substring(11, editButton.Length - 11)); System.Data.DataView dv = (System.Data.DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty); int idsms = Convert.ToInt32(dv.ToTable().Rows[index]["id"]); cnn.Open(); SqlCommand cmd_read = new SqlCommand("update messages set sender=1 where id=" + idsms + "", cnn); cmd_read.ExecuteNonQuery();//update read sms cnn.Close(); gridsent.DataBind(); } else if (aplicate != null && aplicate == "show") { index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gridsent.Rows[index]; System.Data.DataView dv = (System.Data.DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty); txtfullmsg.Text = Convert.ToString(dv.ToTable().Rows[index]["msg"]); int idsms = Convert.ToInt32(dv.ToTable().Rows[index]["id"]); txtfullmsg.Visible = true; btnread.Visible = true; } } }
private void UpdateTable() { DataTable dt = new DataTable(); dt.Columns.Add("GolfID", typeof(string)); dt.Columns.Add("Förnamn", typeof(string)); dt.Columns.Add("Efternamn", typeof(string)); String sql = "SELECT golf_id, förnamn, efternamn FROM medlem;"; NpgsqlCommand command = new NpgsqlCommand(sql, GolfReception.conn); NpgsqlDataReader ndr = command.ExecuteReader(); while (ndr.Read()) { DataRow row = dt.NewRow(); row["GolfID"] = ndr["golf_id"]; row["Förnamn"] = ndr["förnamn"]; row["Efternamn"] = ndr["efternamn"]; dt.Rows.Add(row); } ndr.Close(); DataView dv = new DataView(dt); //TODO Fix this filter, only golfId working dv.RowFilter = "GolfID LIKE '" + golfId_textBox.Text + "*' AND Förnamn LIKE '" + firstName_textBox.Text + "*' AND Efternamn LIKE '" + lastName_textBox.Text + "*'"; //Set the component data dataGridView.DataSource = dv; //Set column header text dataGridView.Columns[0].HeaderText = "Golf-ID"; dataGridView.Columns[1].HeaderText = "Förnamn"; dataGridView.Columns[2].HeaderText = "Efternamn"; }
public BorrowerGUI() { InitializeComponent(); DataSet ds = BorrowerDA.SelectDS(); DataView dv = new DataView(ds.Tables[0]); dataGridView1.DataSource = dv; }
private void button1_Click(object sender, EventArgs e) { sbData.Clear(); openFileDialog1.Filter = "XML files|*.xml"; DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) // Test result. { string file = openFileDialog1.FileName; dt.Clear(); try { dscomponents.Tables.RemoveAt(0); } catch { } try { dscomponents.Tables.RemoveAt(1); } catch { } FileStream finschema = new FileStream(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\board.xsd", FileMode.Open, FileAccess.Read, FileShare.Read); dscomponents.ReadXmlSchema(finschema); finschema.Close(); FileStream findata = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); dscomponents.ReadXml(findata); findata.Close(); dsData = new DataView(dscomponents.Tables["Component"]); } }
public void fillData() { int idGDV = int.Parse(Request.Cookies["MaGDV"].Value); DataTable dt = daoNews.GetListByGDV(idGDV); PagedDataSource pgitems = new PagedDataSource(); System.Data.DataView dv = new System.Data.DataView(dt); pgitems.DataSource = dv; pgitems.AllowPaging = true; pgitems.PageSize = 20; if (PageNumber >= pgitems.PageCount) PageNumber = 0; pgitems.CurrentPageIndex = PageNumber; if (pgitems.PageCount > 1) { rptPages.Visible = true; System.Collections.ArrayList pages = new System.Collections.ArrayList(); for (int i = 0; i < pgitems.PageCount; i++) pages.Add((i + 1).ToString()); rptPages.DataSource = pages; rptPages.DataBind(); } else rptPages.Visible = false; repeaterList.DataSource = pgitems; repeaterList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { bllSanPham = new SanPhamBLL(); DataTable dtNewPhone = bllSanPham.selectSPByNew(); PagedDataSource pdsNewPhone = new PagedDataSource(); DataView dvNewPhone = new DataView(dtNewPhone); pdsNewPhone.DataSource = dvNewPhone; pdsNewPhone.AllowPaging = true; pdsNewPhone.PageSize = 4; NewPhone.DataSource = pdsNewPhone; NewPhone.DataBind(); // bllSanPham = new SanPhamBLL(); DataTable dtSmartPhone = bllSanPham.selectSPByIDPhanLoai(1); PagedDataSource pdsSmartPhone = new PagedDataSource(); DataView dvSmartPhone = new DataView(dtSmartPhone); pdsSmartPhone.DataSource = dvSmartPhone; pdsSmartPhone.AllowPaging = true; pdsSmartPhone.PageSize = 4; SmartPhone.DataSource = pdsSmartPhone; SmartPhone.DataBind(); // bllSanPham = new SanPhamBLL(); DataTable dtPhoThong = bllSanPham.selectSPByIDPhanLoai(0); PagedDataSource pdsPhoThong = new PagedDataSource(); DataView dvPhoThong = new DataView(dtPhoThong); pdsPhoThong.DataSource = dvPhoThong; pdsPhoThong.AllowPaging = true; pdsPhoThong.PageSize = 4; PhoThong.DataSource = pdsPhoThong; PhoThong.DataBind(); }
private void formMatch_Load(object sender, EventArgs e) { var data = new DataTable(); data.Columns.Add("Person"); data.Columns.Add("Chromosome"); data.Columns.Add("Start Point"); data.Columns.Add("End Point"); data.Columns.Add("SNPs"); data.Columns.Add("centiMorgans"); data.Columns.Add("Source"); var lastId = Guid.Empty; var lastName = String.Empty; Personv2 matchPerson; foreach (Match match in Repository.GetChromosomes(person.Id)) { var row = data.NewRow(); row["Chromosome"] = match.ChromosomeText; row["Start Point"] = match.StartPoint; row["End Point"] = match.EndPoint; row["SNPs"] = match.SNPs; row["centiMorgans"] = match.GeneticDistance; row["Source"] = match.FamilyTreeDna ? "Family Tree" : match.MeAnd23 ? "23AndMe" : ""; if (person.Id == match.Id0) matchPerson = Repository.FindPerson(match.Id1); else matchPerson = Repository.FindPerson(match.Id0); row["Person"] = matchPerson.Name; data.Rows.Add(row); } var view = new DataView(data); DataTable distinctValues = view.ToTable(true, "Chromosome", "Start Point", "End Point", "SNPs", "centiMorgans","Person","Source"); radGridView1.DataSource = distinctValues; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_PLACA_ODBICI_GODINADataSet1.S_PLACA_ODBICI_GODINA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsBENEFICIRANIDataSet1.BENEFICIRANI; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsSP_LISTA_IZNOSA_RADNIKADataSet1.SP_LISTA_IZNOSA_RADNIKA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsRAD1MELEMENTIVEZADataSet1.RAD1MELEMENTIVEZA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsSHEMADDDataSet1.SHEMADD; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_OS_PREGLED_AMORTIZACIJE_REKAPITULACIJADataSet1.S_OS_PREGLED_AMORTIZACIJE_REKAPITULACIJA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsDDIZDATAKDataSet1.DDIZDATAK; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_FIN_IRA_PLACANJEDataSet1.S_FIN_IRA_PLACANJE; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_OD_STANJE_KREDITADataSet1.S_OD_STANJE_KREDITA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsURAVRSTAIZNOSADataSet1.URAVRSTAIZNOSA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsBLAGAJNADataSet1.BLAGAJNA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dssp_id_zaglavljeDataSet1.sp_id_zaglavlje; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsGRUPEKOEFDataSet1.GRUPEKOEF; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsRSVRSTEOBVEZNIKADataSet1.RSVRSTEOBVEZNIKA; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsKRIZNIPOREZDataSet1.KRIZNIPOREZ; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsDRZAVLJANSTVODataSet1.DRZAVLJANSTVO; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJIDataSet1.S_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJI; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsPRPLACEDataSet1.PRPLACE; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void setDataView(DataSet documentsData) { myDataView = documentsData.Tables[0].DefaultView; foreach (DataRow dr in myDataView.Table.Rows) { dr["contentType"] = imageAsign((string)dr["contentType"]); } }
private void BindDataGrid() { this.dv1 = new System.Data.DataView(); this.dv1.Table = this.dsS_PLACA_RAD1M_DIO1DataSet1.S_PLACA_RAD1M_DIO1; BindingSource source = new BindingSource(this.dv1, ""); this.DataSource = source; }
private void pmInitGridProp2() { //this.grdBakRev.SetDataBinding(this.dtsDataEnv.Tables[this.mstrAlias2], ""); //this.grdBakRev.RetrieveStructure(); System.Data.DataView dvBrow = this.dtsDataEnv.Tables[this.mstrAlias2].DefaultView; dvBrow.Sort = "dDate, cRefNo"; this.grdBakRev.DataSource = this.dtsDataEnv.Tables[this.mstrAlias2]; for (int intCnt = 0; intCnt < this.gridView1.Columns.Count; intCnt++) { this.gridView1.Columns[intCnt].Visible = false; } this.gridView1.Columns["cQnCoor"].VisibleIndex = 0; this.gridView1.Columns["cRefNo"].VisibleIndex = 1; this.gridView1.Columns["dDate"].VisibleIndex = 2; this.gridView1.Columns["cLot"].VisibleIndex = 3; this.gridView1.Columns["cQnUM"].VisibleIndex = 4; this.gridView1.Columns["nQty"].VisibleIndex = 5; this.gridView1.Columns["dDueDate"].VisibleIndex = 6; this.gridView1.Columns["cQnCoor"].Visible = true; this.gridView1.Columns["cRefNo"].Visible = true; this.gridView1.Columns["dDate"].Visible = true; this.gridView1.Columns["cLot"].Visible = true; this.gridView1.Columns["cQnUM"].Visible = true; this.gridView1.Columns["nQty"].Visible = true; this.gridView1.Columns["dDueDate"].Visible = true; this.gridView1.Columns["cQnCoor"].Caption = (this.mstrSaleOrBuy == "S" ? "ชื่อลูกค้า" : "ชื่อผู้จำหน่าย"); this.gridView1.Columns["cRefNo"].Caption = "เลขที่ภายใน"; this.gridView1.Columns["dDate"].Caption = "วันที่"; this.gridView1.Columns["cLot"].Caption = "ล็อต"; this.gridView1.Columns["nQty"].Caption = "จำนวนค้าง" + (this.mstrSaleOrBuy == "S" ? "ส่ง" : "รับ"); this.gridView1.Columns["cQnUM"].Caption = "หน่วยนับ"; this.gridView1.Columns["dDueDate"].Caption = "วันที่ส่งของ"; this.gridView1.Columns["cRefNo"].Width = 65; this.gridView1.Columns["dDate"].Width = 40; this.gridView1.Columns["cLot"].Width = 35; this.gridView1.Columns["nQty"].Width = 50; this.gridView1.Columns["cQnUM"].Width = 60; this.gridView1.Columns["dDueDate"].Width = 40; this.gridView1.Columns["nQty"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["nQty"].DisplayFormat.FormatString = "#,###,###.00"; this.gridView1.Columns["dDate"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["dDate"].DisplayFormat.FormatString = "dd/MM/yy"; this.gridView1.Columns["dDueDate"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["dDueDate"].DisplayFormat.FormatString = "dd/MM/yy"; //this.grdBakRev.RootTable.SortKeys.Add(new Janus.Windows.GridEX.GridEXSortKey(this.gridView1.Columns["dDate"], Janus.Windows.GridEX.SortOrder.Ascending)); //this.grdBakRev.RootTable.SortKeys.Add(new Janus.Windows.GridEX.GridEXSortKey(this.gridView1.Columns["cRefNo"], Janus.Windows.GridEX.SortOrder.Ascending)); }
private void saveToolStripButton_Click(object sender, EventArgs e) { int index = xtraTabControl_WORD_MNG_DETAY.SelectedTabPageIndex; if (index != -1) { var rtb = xtraTabControl_WORD_MNG_DETAY.TabPages[index].Controls[0]; DevExpress.XtraGrid.GridControl grd_ = (DevExpress.XtraGrid.GridControl)rtb; System.Data.DataView RW = (System.Data.DataView)grd_.DataSource; SqlConnection con = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()); con.Open(); if (RW != null) { TARIFELER._GLOBAL_TARIFELER WORD = new TARIFELER._GLOBAL_TARIFELER(); // SATIR SİL RW.RowStateFilter = DataViewRowState.Deleted; if (RW.Count != 0) { for (int i = 0; i <= RW.Count - 1; i++) { DataRow DR = RW[i].Row; WORD.KEYWORD_ROW_DELETE(con, DR, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Name, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Tag.ToString()); } } // Yeni eklenmiş Satırları kaydet RW.RowStateFilter = DataViewRowState.Added; if (RW.Count != 0) { for (int i = 0; i <= RW.Count - 1; i++) { DataRow DR = RW[i].Row; WORD.KEYWORD_ROW_ADD(con, DR, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Name, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Tag.ToString()); } } // SATIR GUNCELLE RW.RowStateFilter = DataViewRowState.ModifiedOriginal; if (RW.Count != 0) { for (int i = 0; i <= RW.Count - 1; i++) { DataRow DR = RW[i].Row; if (DR["ID"].ToString() == "") { WORD.KEYWORD_ROW_ADD(con, DR, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Name, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Tag.ToString()); } else { WORD.KEYWORD_ROW_UPDATE(con, DR, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Name, xtraTabControl_WORD_MNG_DETAY.SelectedTabPage.Tag.ToString()); } } } RW.Table.AcceptChanges(); RW.RowStateFilter = DataViewRowState.CurrentRows; } } }
/// <summary> /// Hydration method /// </summary> /// <param name="view">View</param> internal virtual void Initialize(System.Data.DataView view) { foreach (DataRowView rowView in view) { T entity = EntityBaseReadOnly.GetEntityInstance <T>(); entity.Initialize(rowView); base.Add(entity); } }
/// <summary> /// todoComment /// </summary> /// <param name="ADataSource"></param> /// <param name="ADataMemberTextBoxMiddlePanel"></param> /// <param name="ADataMemberTextBoxLowerPanel"></param> public void PerformDataBindingTextBoxes(System.Data.DataView ADataSource, String ADataMemberTextBoxMiddlePanel, String ADataMemberTextBoxLowerPanel) { this.FDataMemberTextBoxMiddlePanel = ADataMemberTextBoxMiddlePanel; this.PerformDataBindingTextBoxMiddlePanel(ADataSource, ADataMemberTextBoxMiddlePanel); this.FDataMemberTextBoxLowerPanel = ADataMemberTextBoxLowerPanel; this.PerformDataBindingTextBoxLowerPanel(ADataSource, ADataMemberTextBoxLowerPanel); }
public static void PopulateControl(ComboBox ComboControl, System.Data.DataView DataSource, int DisplayFieldOrdinal, int ValueFieldOrdinal, string DefaultText, int DefaultValue) { System.Data.DataRow drNewRow = DataSource.Table.NewRow(); drNewRow[DisplayFieldOrdinal] = DefaultText; drNewRow[ValueFieldOrdinal] = DefaultValue; DataSource.Table.Rows.InsertAt(drNewRow, 0); DataSource.Table.AcceptChanges(); PopulateControl(ComboControl, DataSource.Table.DefaultView, DisplayFieldOrdinal, ValueFieldOrdinal); }
private void pmInitGridProp() { //this.grdBrowView.SetDataBinding(this.dtsDataEnv.Tables[this.mstrAlias], ""); //this.grdBrowView.RetrieveStructure(); System.Data.DataView dvBrow = this.dtsDataEnv.Tables[this.mstrAlias].DefaultView; //dvBrow.Sort = "dDate, cRefNo"; this.grdBrowView.DataSource = this.dtsDataEnv.Tables[this.mstrAlias]; for (int intCnt = 0; intCnt < this.gridView1.Columns.Count; intCnt++) { this.gridView1.Columns[intCnt].Visible = false; } this.gridView1.Columns["cType"].Group(); this.gridView1.Columns["cType"].VisibleIndex = 0; this.gridView1.Columns["dDate"].VisibleIndex = 1; this.gridView1.Columns["cQcBank"].VisibleIndex = 2; this.gridView1.Columns["cCode"].VisibleIndex = 3; this.gridView1.Columns["nAmt"].VisibleIndex = 4; this.gridView1.Columns["cType"].Visible = true; this.gridView1.Columns["dDate"].Visible = true; this.gridView1.Columns["cQcBank"].Visible = true; this.gridView1.Columns["cCode"].Visible = true; this.gridView1.Columns["nAmt"].Visible = true; this.gridView1.Columns["cType"].Caption = ""; this.gridView1.Columns["dDate"].Caption = "วันที่ในเช็ค"; this.gridView1.Columns["cQcBank"].Caption = "ธนาคาร"; this.gridView1.Columns["cCode"].Caption = "เลขที่เช็ค"; this.gridView1.Columns["nAmt"].Caption = "จำนวนเงิน"; this.gridView1.Columns["cType"].Width = 60; this.gridView1.Columns["dDate"].Width = 40; this.gridView1.Columns["cQcBank"].Width = 60; this.gridView1.Columns["cCode"].Width = 60; this.gridView1.Columns["nAmt"].Width = 50; this.gridView1.Columns["nAmt"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["nAmt"].DisplayFormat.FormatString = "#,###,###.00"; this.gridView1.Columns["dDate"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["dDate"].DisplayFormat.FormatString = "dd/MM/yy"; //this.gridView1.SortKeys.Add(new Janus.Windows.GridEX.GridEXSortKey(this.gridView1.Columns["dDate"], Janus.Windows.GridEX.SortOrder.Ascending)); //this.gridView1.SortKeys.Add(new Janus.Windows.GridEX.GridEXSortKey(this.gridView1.Columns["cRefNo"], Janus.Windows.GridEX.SortOrder.Ascending)); ////this.gridView1.Columns[this.mstrSortKey].CellStyle.BackColor = Color.WhiteSmoke; this.gridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "nAmt", this.gridView1.Columns["nAmt"], "{0:n2}"); this.grdBrowView.Focus(); this.gridView1.ExpandAllGroups(); }
private void pmInitGridProp() { System.Data.DataView dvBrow = this.dtsDataEnv.Tables[this.mstrBrowViewAlias].DefaultView; dvBrow.Sort = "FCQCORDERH"; this.grdBrowView.DataSource = this.dtsDataEnv.Tables[this.mstrBrowViewAlias]; for (int intCnt = 0; intCnt < this.gridView1.Columns.Count; intCnt++) { this.gridView1.Columns[intCnt].Visible = false; } this.gridView1.Columns["FCQCORDERH"].VisibleIndex = 0; this.gridView1.Columns["FCREFNO"].VisibleIndex = 1; this.gridView1.Columns["FDDATE"].VisibleIndex = 2; this.gridView1.Columns["NAMT"].VisibleIndex = 3; this.gridView1.Columns["FCQCORDERH"].Visible = true; this.gridView1.Columns["FCREFNO"].Visible = true; this.gridView1.Columns["FDDATE"].Visible = true; this.gridView1.Columns["NAMT"].Visible = true; this.gridView1.Columns["FCQCORDERH"].Width = 50; this.gridView1.Columns["FDDATE"].Width = 50; this.gridView1.Columns["FCREFNO"].Width = 50; this.gridView1.Columns["NAMT"].Width = 50; this.gridView1.Columns["FCQCORDERH"].Caption = "àÅ¢·ÕèÀÒÂã¹"; this.gridView1.Columns["FCREFNO"].Caption = "àÅ¢·ÕèÍéÒ§ÍÔ§"; this.gridView1.Columns["FDDATE"].Caption = "Çѹ·Õè"; this.gridView1.Columns["NAMT"].Caption = "ÁÙŤèÒ"; this.gridView1.Columns["NAMT"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; this.gridView1.Columns["NAMT"].DisplayFormat.FormatString = "#,###,###.00"; //this.grdBrowView.ColumnAutoResize = true; if (this.mstrCoor == string.Empty) { this.gridView1.Columns["FCQNCOOR"].VisibleIndex = 4; this.gridView1.Columns["FCQNCOOR"].Visible = true; this.gridView1.Columns["FCQNCOOR"].Caption = this.mstrCoorStr; this.gridView1.Columns["FCQCORDERH"].Width = 50; this.gridView1.Columns["FDDATE"].Width = 50; this.gridView1.Columns["FCREFNO"].Width = 50; //this.gridView1.Columns["fcQnCoor"].AutoSize(); } else { this.gridView1.Columns["FCQCORDERH"].Width = 50; this.gridView1.Columns["FDDATE"].Width = 50; this.gridView1.Columns["FCREFNO"].Width = 50; } this.pmSetSortKey("FCQCORDERH", true); }
/// <summary> /// Binds the grid. /// </summary> private void BindGrid() { pnlUpdateMessage.Visible = false; pnlResults.Visible = true; int?accountId = apAccount.SelectedValue.AsIntegerOrNull(); if (accountId.HasValue) { var dateRange = SlidingDateRangePicker.CalculateDateRangeFromDelimitedValues(drpDateRange.DelimitedValues); var start = dateRange.Start; var end = dateRange.End; var minPledgeAmount = nrePledgeAmount.LowerValue; var maxPledgeAmount = nrePledgeAmount.UpperValue; var minComplete = nrePercentComplete.LowerValue; var maxComplete = nrePercentComplete.UpperValue; var minGiftAmount = nreAmountGiven.LowerValue; var maxGiftAmount = nreAmountGiven.UpperValue; int includeOption = rblInclude.SelectedValueAsInt() ?? 0; bool includePledges = includeOption != 1; bool includeGifts = includeOption != 0; DataSet ds = FinancialPledgeService.GetPledgeAnalytics(accountId.Value, start, end, minPledgeAmount, maxPledgeAmount, minComplete, maxComplete, minGiftAmount, maxGiftAmount, includePledges, includeGifts); System.Data.DataView dv = ds.Tables[0].DefaultView; if (gList.SortProperty != null) { try { var sortProperties = new List <string>(); foreach (string prop in gList.SortProperty.Property.SplitDelimitedValues(false)) { sortProperties.Add(string.Format("[{0}] {1}", prop, gList.SortProperty.DirectionString)); } dv.Sort = sortProperties.AsDelimited(", "); } catch { dv.Sort = "[LastName] ASC, [NickName] ASC"; } } else { dv.Sort = "[LastName] ASC, [NickName] ASC"; } gList.DataSource = dv; gList.DataBind(); } }
/// <summary> /// 查询方法 /// </summary> /// <param name="hphm"></param> /// <param name="cllx"></param> /// <param name="start"></param> /// <param name="end"></param> /// <param name="gccs"></param> /// <param name="ljsc"></param> /// <param name="ljcs"></param> /// <returns></returns> private void query(string hphm, string cllx, string start, string end, string gccs, string ljsc, string ljcs) { int startrow = 0, len = 30, endrow = 29; string xml = "", rsxml = ""; Dt_passcar.Clear(); Dt_result.Clear(); xml = getxml(startrow, len, start, end, cllx, hphm, gccs, ljsc, ljcs); try { rsxml = client.GetFootholdInfo(xml); } catch (Exception ex) { Notice(GetLangStr("FootHold36", "提示"), GetLangStr("FootHold30", "接口服务报错!")); ILog.WriteErrorLog(ex.Message); } //rsxml = "<?xml version='1.0' encoding='UTF-8'?><Message><Version>1.0</Version><Type>RESPONSE</Type><Body><Return><kkidlist totalnum='1'><kkid name='701111007000' ljcs='1' ljsj='1' type='1'><passcar><kssj>2016-04-25 19:03:03 123</kssj><jssj>2016-04-26 19:03:03 123</jssj><fx>01</fx><sc>1</sc></passcar></kkid><kkid name='609381055000' ljcs='1' ljsj='1' type='2'><passcar><kssj>2016-04-25 19:03:03 123</kssj><jssj>2016-04-26 19:03:03 123</jssj><fx>01</fx><sc>1</sc></passcar></kkid><kkid name='609321057000' ljcs='1' ljsj='1' type='0'><passcar><kssj>2016-04-25 19:03:03 123</kssj><jssj>2016-04-26 19:03:03 123</jssj><fx>01</fx><sc>1</sc></passcar></kkid><kkid name='709011060000' ljcs='1' ljsj='1' type='1'><passcar><kssj>2016-04-25 19:03:03 123</kssj><jssj>2016-04-26 19:03:03 123</jssj><fx>01</fx><sc>1</sc></passcar></kkid><kkid name='601181002000' ljcs='1' ljsj='1' type='2'><passcar><kssj>2016-04-25 19:03:03 123</kssj><jssj>2016-04-26 19:03:03 123</jssj><fx>01</fx><sc>1</sc></passcar></kkid></kkidlist></Return></Body></Message>"; if (rsxml != "" && getlenxml(rsxml) > 0) { CXmlToDataTable(rsxml); while (getlenxml(rsxml) > endrow) { startrow = startrow + len; endrow = endrow + len; xml = getxml(startrow, endrow, start, end, cllx, hphm, gccs, ljsc, ljcs); rsxml = client.GetFootholdInfo(xml); CXmlToDataTable(rsxml); } } if (Dt_result != null && Dt_result.Rows.Count > 0) { DataTable dtCopy = Dt_result.Copy(); System.Data.DataView dv = Dt_result.DefaultView; dv.Sort = "type desc"; dtCopy = dv.ToTable(); this.StoreInfo.DataSource = dtCopy;// Dt_result; this.StoreInfo.DataBind(); if (start == "" && end == "" && gccs == "" && ljsc == "" && ljcs == "") { ShowFoot(false); } else { ShowFoot(true); } } else { this.StoreInfo.RemoveAll(); this.StoreInfo.DataBind(); Notice(GetLangStr("FootHold36", "提示"), GetLangStr("FootHold31", "无数据!")); } }