public void AsDynamicXml_WhenGivenValidGridRow_ShouldReturnDynamicXml() { var c = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; var x = c.AsDynamicXml(); Assert.IsInstanceOfType(x, typeof(DynamicXml)); }
public void GridRow_SetsModel() { Object expected = new Object(); Object actual = new GridRow<Object>(expected).Model; Assert.Same(expected, actual); }
public void RowDataBound(object sender, GridRowEventArgs e) { if (e.Row.RowType == GridRowType.DataRow) { if (lastGroupHeader != null) { Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal; textContainer.Text = ((GridDataControlFieldCell)e.Row.Cells[2]).Text; textContainer.Text += " » "; HyperLink link = new HyperLink(); link.CssClass = "header-link"; link.Attributes["onclick"] = "alert('In a real application the category form should open.')"; link.NavigateUrl = "aspnet_grouping_custom_headers.aspx?CategoryID=" + ((GridDataControlFieldCell)e.Row.Cells[1]).Text; link.Text = "Edit Category"; textContainer.Parent.Controls.Add(link); lastGroupHeader = null; } } else if (e.Row.RowType == GridRowType.GroupHeader) { if (e.Row.GroupLevel == 0) { lastGroupHeader = e.Row; } } }
public void Insert_WhenGivenGridRowsWithNonUniqueIds_ShouldThrowException() { var c = new GridRowCollection(); var r1 = new GridRow(0) { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; var r2 = new GridRow(0) { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; c.Insert(0, r1); c.Insert(0, r2); }
public static GridRow CreateRow(int i) { var row = new GridRow(); foreach (var p in props) { p.SetValue(row, p.Name + i); } return row; }
public void ToString_WhenGivenValidGridRow_ShouldReturnValidXmlString() { var c = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; var doc = new XmlDocument(); doc.LoadXml(c.ToString()); Assert.IsNotNull(doc); }
public void Insert_WhenGivenGridRowsWithUniqueIds_ShouldAddGridRow() { var c = new GridRowCollection(); var r1 = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; var r2 = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } }; c.Insert(0, r1); c.Insert(0, r2); Assert.IsTrue(c.Any(x => x.Id == r1.Id)); Assert.IsTrue(c.Any(x => x.Id == r2.Id)); }
public static GridRow getonerow(UserShip us) { object[] vals = new object[19]; vals[0] = us.fleetId > 0 ? (GameData.instance.UserFleets[us.fleetId - 1].title) : ""; vals[1] = us.level; vals[2] = us.ship.title; vals[3] = tools.helper.getshiptype(us.ship.type); vals[4] = tools.helper.getShipSmallImage(us); vals[5] = 100 * us.battleProps.hp / us.battlePropsMax.hp; vals[6] = "" + us.battleProps.hp + "/" + us.battlePropsMax.hp; vals[7] = "修理";// + "/" + us.battlePropsMax.atk; vals[8] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; return gr; }
private void addresult(UserShip us, ShipConfig sc) { var panel = dislist.PrimaryGrid; if (sc != null) { object[] vals = new object[6]; vals[0] = "" + sc.cid + "-" + sc.title; vals[1] = tools.helper.getstartstring(sc.star); vals[2] = tools.helper.getshiptype(sc.type); vals[3] = sc.title; vals[4] = tools.helper.getShipSmallImage(us); vals[5] = sc.cid; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 30; } }
private void updateDrop(string nodename, bool viewbywintype) { try { var response = p.GetAsync(tools.helper.count_server_addr + "/analyze/" + (viewbywintype ? "weapon/weapon_" : "ship/ship_") + nodename + ".json").Result; response.EnsureSuccessStatusCode(); var content = response.Content.ReadAsByteArrayAsync().Result; string ss = System.Text.Encoding.UTF8.GetString(content); NodeDrop list = new JsonFx.Json.JsonReader().Read<NodeDrop>(ss); GridPanel panel = droplist.PrimaryGrid; panel.Rows.Clear(); int totalcount = 0; foreach (var cl in list.nodeval) { totalcount += cl.count; } float t = (float)totalcount; foreach (var cl in list.nodeval) { object[] vals = new object[6]; vals[0] = cl.name; vals[1] = cl.count; float c = (float)cl.count; vals[2] = "" + (c * 100.0f / t) + "%"; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 20; } } catch (Exception) { } }
private void listUpdateManager_Update(object sender, EventArgs e) { GridRow root = new GridRow(-1); RowGroupAcceptor acceptor = new RowGroupAcceptor(root); CollectionAcceptor ca = new CollectionAcceptor(); bool addedAny = search.PopulateAdapters(acceptor, ca); Program.Invoke(Program.MainWindow, delegate { SaveRowStates(); Clear(); if (!addedAny) { AddNoResultsRow(); } foreach (GridRow row in root.Rows) { AddRow(row); } MetricUpdater.SetXenObjects(ca.XenObjects.ToArray()); RestoreRowStates(); Refresh(); }); }
public override bool IsDraggableRow(GridRow row) { IXenObject o = row.Tag as IXenObject; return o != null; }
private static GridRow NewGroupRow(string opaqueref, object tag, int rowHeight, int priority) { GridRow row = new GridRow(rowHeight); row.OpaqueRef = opaqueref; row.Tag = tag; row.Expanded = true; row.Priority = priority; return row; }
/// <summary> /// 调用控件线程方法 /// </summary> /// <param name="args">参数</param> public override void OnInvoke(object args) { base.OnInvoke(args); if (args != null) { CMessage message = (CMessage)args; if (message.m_requestID == m_requestID) { //分时数据 if (message.m_functionID == QuoteService.FUNCTIONID_QUOTE_PUSHLATESTDATA) { LatestDataInfo dataInfo = new LatestDataInfo(); List <SecurityLatestData> datas = new List <SecurityLatestData>(); QuoteService.GetLatestDatas(ref dataInfo, datas, message.m_body, message.m_bodyLength); SecurityLatestData latestData = datas[0]; if (latestData != null && latestData.m_securityCode == m_securityCode && !latestData.Equal(m_latestData)) { m_latestData = latestData; //设置保留小数的位数 int digit = 2; if (m_latestData.m_securityCode.StartsWith("1") || m_latestData.m_securityCode.StartsWith("5")) { digit = 3; } m_chart.Digit = digit; m_chart.RefreshData(); } } //LV2分时数据 else if (message.m_functionID == QuoteService.FUNCTIONID_QUOTE_PUSHLATESTDATALV2) { LatestDataInfoLV2 dataInfo = new LatestDataInfoLV2(); List <SecurityLatestDataLV2> datas = new List <SecurityLatestDataLV2>(); QuoteService.GetLatestDatasLV2(ref dataInfo, datas, message.m_body, message.m_bodyLength); SecurityLatestDataLV2 latestDataLV2 = datas[0]; if (latestDataLV2 != null && latestDataLV2.m_securityCode == m_securityCode && !latestDataLV2.Equal(m_latestDataLV2)) { m_latestDataLV2 = latestDataLV2; } } //成交数据 else if (message.m_functionID == QuoteService.FUNCTIONID_QUOTE_PUSHTRANSACTIONDATA) { String securityCode = ""; List <TransactionData> transactionDatas = new List <TransactionData>(); QuoteService.GetTransactionDatas(ref securityCode, transactionDatas, message.m_body, message.m_bodyLength); int transactionDatasSize = transactionDatas.Count; for (int i = 0; i < transactionDatasSize; i++) { TransactionData transactionData = transactionDatas[i]; DateTime date = CStrA.ConvertNumToDate(transactionData.m_date); GridRow row = new GridRow(); m_gridTransaction.InsertRow(0, row); TransactionDateCell dateCell = new TransactionDateCell(); dateCell.Text = date.ToString("HH:mm:ss"); row.AddCell(0, dateCell); GridCellStyle dateCellStyle = new GridCellStyle(); dateCellStyle.BackColor = COLOR.EMPTY; dateCellStyle.Font = new FONT("SimSun", 14, true, false, false); dateCellStyle.ForeColor = CDraw.PCOLORS_FORECOLOR2; dateCell.Style = dateCellStyle; TransactionDataDoubleCell priceCell = new TransactionDataDoubleCell(); priceCell.Digit = 2; priceCell.SetDouble(transactionData.m_price); row.AddCell(1, priceCell); GridCellStyle priceCellStyle = new GridCellStyle(); priceCellStyle.BackColor = COLOR.EMPTY; priceCellStyle.Font = new FONT("SimSun", 14, true, false, false); priceCellStyle.ForeColor = CDraw.GetPriceColor(transactionData.m_price, m_latestData.m_lastClose); priceCell.Style = priceCellStyle; TransactionDataDoubleCell volumeCell = new TransactionDataDoubleCell(); volumeCell.SetDouble(transactionData.m_volume); row.AddCell(2, volumeCell); GridCellStyle volumeCellStyle = new GridCellStyle(); volumeCellStyle.BackColor = COLOR.EMPTY; volumeCellStyle.Font = new FONT("SimSun", 14, true, false, false); if (transactionData.m_type == 0) { volumeCellStyle.ForeColor = CDraw.PCOLORS_FORECOLOR; } else if (transactionData.m_type == 1) { volumeCellStyle.ForeColor = CDraw.PCOLORS_UPCOLOR; } else { volumeCellStyle.ForeColor = CDraw.PCOLORS_DOWNCOLOR; } volumeCell.Style = volumeCellStyle; } m_gridTransaction.Update(); } } Invalidate(); } }
private void btnSave_Click(object sender, EventArgs e) { bool saveInsert; string sRet = CheckForm(out saveInsert); if (sRet.Length > 0) { MessageBox.Show(sRet); return; } DeliveryNote EditNote = new DeliveryNote(); if (EditMode == 2) { EditNote.noteid = int.Parse(noteid.Text); EditNote.deliverid = int.Parse(deliverid.Text); if (objNote == null) { EditNote.sdate = DateTime.Now; } else { EditNote.sdate = objNote.sdate; } } else { EditNote.sdate = DateTime.Now; } EditNote.customer = customer.Text.Trim(); EditNote.model = model.Text.Trim(); EditNote.deliverdate = deliverdate.Value; EditNote.goodname = goodname.Text.Trim(); EditNote.batch = batch.Text; EditNote.description = description.Text; EditNote.description1 = description1.Text; EditNote.loginid = Global.LoginUser.loginid; SysDictDAC dac = new SysDictDAC(); SysDictEntity dictEntity = dac.Select("model", EditNote.model); if (dictEntity == null) { dictEntity = new SysDictEntity(); dictEntity.dictype = "model"; dictEntity.dictvalue = EditNote.model; dac.Add(dictEntity); } dictEntity = null; dictEntity = dac.Select("goodname", EditNote.goodname); if (dictEntity == null) { dictEntity = new SysDictEntity(); dictEntity.dictype = "goodname"; dictEntity.dictvalue = EditNote.goodname; dac.Add(dictEntity); } dictEntity = null; GridPanel panel = superGrid.PrimaryGrid; if (panel.Rows.Count > 0) { List <DeliveryItem> DeliveryItems = new List <DeliveryItem>(); for (int i = 0; i < panel.Rows.Count; i++) { DeliveryItem item = new DeliveryItem(); GridRow curRow = panel.Rows[i] as GridRow; bool bSave = false; if (!curRow.IsInsertRow) { bSave = true; } else { bSave = saveInsert; } if (bSave) { item.noteid = EditNote.noteid; item.jiannum = ControlHelper.Object2String(curRow["jiannum"].Value); string spec = ControlHelper.Object2String(curRow["specifications"].Value); dictEntity = dac.Select("deliveryspec", spec); if (dictEntity == null) { dictEntity = new SysDictEntity(); dictEntity.dictype = "deliveryspec"; dictEntity.dictvalue = spec; dac.Add(dictEntity); } dictEntity = null; item.specifications = spec; item.lenght = ControlHelper.Object2Int(curRow["lenght"].Value); item.discnum = ControlHelper.Object2Int(curRow["discnum"].Value); item.weight = ControlHelper.Object2Double(curRow["weight"].Value); item.price = ControlHelper.Object2Double(curRow["price"].Value.ToString()); item.totalprice = ControlHelper.Object2Double(curRow["totalprice"].Value); item.contractno = ControlHelper.Object2String(curRow["contractno"].Value); item.netweight = ControlHelper.Object2Double(curRow["netweight"].Value); item.coreweight = ControlHelper.Object2Double(curRow["coreweight"].Value.ToString()); DeliveryItems.Add(item); } } EditNote.items = DeliveryItems; } DeliveryDAC dacDelivery = new DeliveryDAC(); if (EditMode == 0 || EditMode == 1) { bool bRet = false; try { bRet = dacDelivery.Add(EditNote); } catch (Exception ex) { MessageBox.Show("操作数据库出错,请检查网络;\r\n原因:" + ex.Message); return; } if (bRet) { if (MessageBox.Show("保存成功,是否继续新建送货单?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { this.DialogResult = DialogResult.OK; this.Close(); } else { EditMode = 1; InitVar(); } } else { MessageBox.Show("保存失败"); } } else { try { dacDelivery.Update(EditNote); } catch (Exception ex) { MessageBox.Show("操作数据库出错,请检查网络;\r\n原因:" + ex.Message); return; } MessageBox.Show("保存成功"); this.DialogResult = DialogResult.OK; this.Close(); } }
public static Dictionary <string, object> AddCalculatedRowConfig(this Dictionary <string, object> settings, GridRow row) { var automaticGridConfig = DependencyResolver.Current.GetServices <IAutomaticGridConfig>(); foreach (var i in automaticGridConfig) { i.AddRowConfig(settings, row); } return(settings); }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; if (_showingInfoButton) //Security.IsAuthorized(Permissions.EhrInfoButton,true)) { { col = new GridColumn("", 18); //infoButton col.ImageList = imageListInfoButton; gridMain.ListGridColumns.Add(col); } col = new GridColumn(Lan.g(this, "SNOMED CT"), 125); //column width of 125 holds the longest Snomed CT code as of 8/7/15 which is 900000000000002006 gridMain.ListGridColumns.Add(col); //col=new ODGridColumn("Deprecated",75,HorizontalAlignment.Center); //gridMain.Columns.Add(col); col = new GridColumn(Lan.g(this, "Description"), 500); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Used By CQM's"), 185); //width 185 so all of our CQM measure nums as of 8/7/15 will fit 68,69,74,75,127,138,147,155,165 gridMain.ListGridColumns.Add(col); //col=new ODGridColumn("Date Of Standard",100); //gridMain.Columns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; if (textCode.Text.Contains(",")) { SnomedList = Snomeds.GetByCodes(textCode.Text); } else { SnomedList = Snomeds.GetByCodeOrDescription(textCode.Text); } if (SnomedList.Count >= 10000) //Max number of results returned. { MsgBox.Show(this, "Too many results. Only the first 10,000 results will be shown."); } List <GridRow> listAll = new List <GridRow>(); for (int i = 0; i < SnomedList.Count; i++) { row = new GridRow(); if (_showingInfoButton) //Security.IsAuthorized(Permissions.EhrInfoButton,true)) { { row.Cells.Add("0"); //index of infobutton } row.Cells.Add(SnomedList[i].SnomedCode); //row.Cells.Add("");//IsActive==NotDeprecated row.Cells.Add(SnomedList[i].Description); row.Cells.Add(EhrCodes.GetMeasureIdsForCode(SnomedList[i].SnomedCode, "SNOMEDCT")); row.Tag = SnomedList[i]; //row.Cells.Add(""); listAll.Add(row); } listAll.Sort(SortMeasuresMet); for (int i = 0; i < listAll.Count; i++) { gridMain.ListGridRows.Add(listAll[i]); } gridMain.EndUpdate(); }
protected override void BindCellContent(View cellContent, GridCellType cellType, GridRow row) { if (cellType == GridCellType.Cell) { var dataItem = row.DataItem; var image = cellContent as Image; if (image != null && dataItem != null) { var value = GetCellValue(cellType, row); image.Source = new ImageConverter().Convert(value, typeof(ImageSource), null, CultureInfo.InvariantCulture) as ImageSource; //image.SetBinding(Image.SourceProperty, new Binding(Binding, converter: new ImageConverter(), source: dataItem)); } } else { base.BindCellContent(cellContent, cellType, row); } }
protected override bool AllowEditing(GridRow row) { return(false); }
private void FillGrid() { if (IsDisposed) //This can happen if an auto logoff happens with FormMedLabEdit open { return; } if (textDateStart.errorProvider1.GetError(textDateStart) != "" || textDateEnd.errorProvider1.GetError(textDateEnd) != "") { return; } textPatient.Text = ""; if (_selectedPat != null) { textPatient.Text = _selectedPat.GetNameLF(); checkOnlyNoPat.Checked = false; } Application.DoEvents(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); gridMain.ListGridColumns.Add(new GridColumn("Date & Time Reported", 135, GridSortingStrategy.DateParse)); //most recent date and time a result came in gridMain.ListGridColumns.Add(new GridColumn("Date & Time Entered", 135, GridSortingStrategy.DateParse)); gridMain.ListGridColumns.Add(new GridColumn("Status", 75)); gridMain.ListGridColumns.Add(new GridColumn("Patient", 180)); gridMain.ListGridColumns.Add(new GridColumn("Provider", 70)); gridMain.ListGridColumns.Add(new GridColumn("Specimen ID", 100)); //should be the ID sent on the specimen container to lab gridMain.ListGridColumns.Add(new GridColumn("Test(s) Description", 235)); //description of the test ordered if (PrefC.HasClinicsEnabled) { gridMain.ListGridColumns.Add(new GridColumn("Clinic", 150)); } gridMain.ListGridRows.Clear(); GridRow row; DateTime dateEnd = PIn.Date(textDateEnd.Text); if (dateEnd == DateTime.MinValue) { dateEnd = DateTime.MaxValue; } Cursor = Cursors.WaitCursor; Clinic clinCur = new Clinic(); if (PrefC.HasClinicsEnabled) { clinCur = _listUserClinics[comboClinic.SelectedIndex]; } List <Clinic> listClinicsSelected = new List <Clinic>(); if (clinCur.ClinicNum == -1) //"All" clinic { listClinicsSelected = _listUserClinics.FindAll(x => x.ClinicNum > -1); //will include ClinicNum 0 ("Unassigned" clinic) if user is unrestricted } else //a single clinic was selected, either the "Unassigned" clinic or a regular clinic { listClinicsSelected.Add(clinCur); } List <MedLab> listMedLabs = MedLabs.GetOrdersForPatient(_selectedPat, checkIncludeNoPat.Checked, checkOnlyNoPat.Checked, PIn.Date(textDateStart.Text), dateEnd, listClinicsSelected); Dictionary <long, Patient> dictPats = Patients.GetLimForPats(listMedLabs.Select(x => x.PatNum).Where(x => x > 0).Distinct().ToList()) .ToDictionary(x => x.PatNum); foreach (MedLab medLabCur in listMedLabs) { row = new GridRow(); row.Cells.Add(medLabCur.DateTimeReported.ToString("MM/dd/yyyy hh:mm tt")); row.Cells.Add(medLabCur.DateTimeEntered.ToString("MM/dd/yyyy hh:mm tt")); if (medLabCur.IsPreliminaryResult) //check whether the test or any of the most recent results for the test is marked as preliminary { row.Cells.Add(MedLabs.GetStatusDescript(ResultStatus.P)); } else { row.Cells.Add(MedLabs.GetStatusDescript(medLabCur.ResultStatus)); } string nameFL = ""; if (dictPats.ContainsKey(medLabCur.PatNum)) { nameFL = dictPats[medLabCur.PatNum].GetNameFLnoPref(); } row.Cells.Add(nameFL); row.Cells.Add(Providers.GetAbbr(medLabCur.ProvNum)); //will be blank if ProvNum=0 row.Cells.Add(medLabCur.SpecimenID); row.Cells.Add(medLabCur.ObsTestDescript); if (PrefC.HasClinicsEnabled) { string clinicDesc = ""; if (_dictLabAcctClinic.ContainsKey(medLabCur.PatAccountNum)) { clinicDesc = _dictLabAcctClinic[medLabCur.PatAccountNum]; } row.Cells.Add(clinicDesc); } row.Tag = medLabCur.PatNum.ToString() + "," + medLabCur.SpecimenID + "," + medLabCur.SpecimenIDFiller; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); Cursor = Cursors.Default; }
protected override View CreateCellContent(GridCellType cellType, object cellContentType, GridRow row) { if (cellType == GridCellType.Cell) { return(new Image()); } else { return(base.CreateCellContent(cellType, cellContentType, row)); } }
protected override void BindCellContent(UIView cellContent, GridCellType cellType, GridRow row) { if (cellType == GridCellType.Cell) { var gauge = cellContent as C1BulletGraph; gauge.Value = (double)GetCellValue(cellType, row); } else { base.BindCellContent(cellContent, cellType, row); } }
protected override UIView CreateCellContent(GridCellType cellType, object cellContentType, GridRow row) { if (cellType == GridCellType.Cell) { var gauge = new C1BulletGraph(); gauge.IsAnimated = false; gauge.Max = 10000; gauge.Target = 7000; gauge.Bad = 1000; gauge.Good = 6000; return(gauge); } else { return(base.CreateCellContent(cellType, cellContentType, row)); } }
private void buttonX1_Click(object sender, System.EventArgs e) { string fileName = "";//保存的excel文件名 SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "导出Excel(*.xls)|*.xls"; sfd.FileName = "选瓷汇总表"; DataSet ds = (DataSet)rptGrid.PrimaryGrid.DataSource; if (ds != null) { if (sfd.ShowDialog() == DialogResult.OK) { fileName = sfd.FileName; int columnNums = rptGrid.PrimaryGrid.Columns.Count; //列数; int rowNums = rptGrid.PrimaryGrid.Rows.Count; //行数 HSSFWorkbook book = new HSSFWorkbook(); ISheet sheet = book.CreateSheet("sheet1"); IRow row = sheet.CreateRow(0); NpoiExcelHelper.setMergedRegion(sheet, row, 0, "产品编号", 0, 1, 0, 0); NpoiExcelHelper.setMergedRegion(sheet, row, 1, "器型名称", 0, 1, 1, 1); NpoiExcelHelper.setMergedRegion(sheet, row, 2, "花色名称", 0, 1, 2, 2); NpoiExcelHelper.setMergedRegion(sheet, row, 3, "窑炉编号", 0, 1, 3, 3); NpoiExcelHelper.setMergedRegion(sheet, row, 4, "瓷质", 0, 1, 4, 4); NpoiExcelHelper.setMergedRegion(sheet, row, 5, "班次", 0, 1, 5, 5); NpoiExcelHelper.setMergedRegion(sheet, row, 6, "A+", 0, 0, 6, 7); NpoiExcelHelper.setMergedRegion(sheet, row, 8, "A等", 0, 0, 8, 9); NpoiExcelHelper.setMergedRegion(sheet, row, 10, "CA等", 0, 0, 10, 11); NpoiExcelHelper.setMergedRegion(sheet, row, 12, "B甲", 0, 0, 12, 13); NpoiExcelHelper.setMergedRegion(sheet, row, 14, "B等", 0, 0, 14, 15); NpoiExcelHelper.setMergedRegion(sheet, row, 16, "C等", 0, 0, 16, 17); NpoiExcelHelper.setMergedRegion(sheet, row, 18, "补釉", 0, 0, 18, 19); NpoiExcelHelper.setMergedRegion(sheet, row, 20, "废品", 0, 0, 20, 21); NpoiExcelHelper.setMergedRegion(sheet, row, 22, "总数", 0, 1, 22, 23); IRow row2 = sheet.CreateRow(1); NpoiExcelHelper.setQtyAndRate(row2, 4, 18, isNeedRate); for (int i = 2; i < rowNums + 2; i++)// { IRow r = sheet.CreateRow(i); if (isNeedRate) { for (int j = 0; j < columnNums; j++) { ICell c = r.CreateCell(j); GridRow gr = (GridRow)rptGrid.PrimaryGrid.Rows[i - 2]; //瓷质 if (gr[j].FormattedValue != "")// gc.DataPropertyName == "FMaterial") { c.SetCellValue(gr[j].FormattedValue.ToString()); } else { c.SetCellValue(gr[j].Value == null ? "" : gr[j].Value.ToString()); } } } else { for (int j = 0; j < 6; j++) { ICell c = r.CreateCell(j); GridRow gr = (GridRow)rptGrid.PrimaryGrid.Rows[i - 2]; //瓷质 if (gr[j].FormattedValue != "")// gc.DataPropertyName == "FMaterial") { c.SetCellValue(gr[j].FormattedValue.ToString()); } else { c.SetCellValue(gr[j].Value == null ? "" : gr[j].Value.ToString()); } } for (int j = 6; j < columnNums; j = j + 2) { ICell c = r.CreateCell(j); CellRangeAddress region = new CellRangeAddress(i, i, j, j + 1); sheet.AddMergedRegion(region); GridRow gr = (GridRow)rptGrid.PrimaryGrid.Rows[i - 2]; //瓷质 if (gr[j].FormattedValue != "")// gc.DataPropertyName == "FMaterial") { c.SetCellValue(gr[j].FormattedValue.ToString()); } else { c.SetCellValue(gr[j].Value == null ? "" : gr[j].Value.ToString()); } } } } //for (int i = 0; i <= rowNums + 2; i++) //{ // sheet.AutoSizeColumn(i); //} FileStream file = new FileStream(fileName, FileMode.OpenOrCreate); book.Write(file); file.Flush(); file.Close(); MessageUtil.ShowTips("导出成功!"); } } }
protected void gridTotales_RowDataBound(object sender, GridRowEventArgs e) { if (e.Row.RowType == GridRowType.DataRow) { tempTotalStockIni += e.Row.Cells[3].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[3].Text); tempTotalIni += e.Row.Cells[4].Text == "" ? 0.0 : double.Parse(e.Row.Cells[4].Text); tempCOMPRA_Cantidad += e.Row.Cells[5].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[5].Text); tempCOMPRA_Total += e.Row.Cells[6].Text == "" ? 0.0 : double.Parse(e.Row.Cells[6].Text); tempVENTA_Cantidad += e.Row.Cells[7].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[7].Text); tempVENTA_Total += e.Row.Cells[8].Text == "" ? 0.0 : double.Parse(e.Row.Cells[8].Text); tempTotalStockFin += e.Row.Cells[9].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[9].Text); tempTotalFin += e.Row.Cells[10].Text == "" ? 0.0 : double.Parse(e.Row.Cells[10].Text); //if (lastGroupHeader != null) //{ // Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal; // textContainer.Text = "<div style='margin-right:100px; float:left;' >Articulo: " + ((GridDataControlFieldCell)e.Row.Cells[1]).Text + " - " + ((GridDataControlFieldCell)e.Row.Cells[2]).Text; // textContainer.Text += "</div><div style='float:left;'>"; // textContainer.Text += "Stock Inicial: " + ((GridDataControlFieldCell)e.Row.Cells[3]).Text + "</div>"; // lastGroupHeader = null; //} } else if (e.Row.RowType == GridRowType.GroupHeader) { //Literal textContainer = e.Row.Cells[0].Controls[0].Controls[1].Controls[0] as Literal; if (!lastGroupHeaders.ContainsKey(e.Row.GroupLevel)) { lastGroupHeaders.Add(e.Row.GroupLevel, null); } lastGroupHeaders[e.Row.GroupLevel] = e.Row; if (e.Row.GroupLevel == 1) { lastGroupHeader = e.Row; } } else if (e.Row.RowType == GridRowType.GroupFooter) { if (e.Row.GroupLevel > 0) { for (int level = e.Row.GroupLevel - 1; level >= 0; level--) { if (!TotalStockIni.ContainsKey(level)) { TotalStockIni.Add(level, 0); TotalIni.Add(level, 0); COMPRA_Cantidad.Add(level, 0); COMPRA_Total.Add(level, 0); VENTA_Cantidad.Add(level, 0); VENTA_Total.Add(level, 0); TotalStockFin.Add(level, 0); TotalFin.Add(level, 0); } TotalStockIni[level] += tempTotalStockIni; TotalIni[level] += tempTotalIni; COMPRA_Cantidad[level] += tempCOMPRA_Cantidad; COMPRA_Total[level] += tempCOMPRA_Total; VENTA_Cantidad[level] += tempVENTA_Cantidad; VENTA_Total[level] += tempVENTA_Total; TotalStockFin[level] += tempTotalStockFin; TotalFin[level] += tempTotalFin; } } int TotalStockIniToDisplay = 0; double TotalIniToDisplay = 0; int COMPRA_CantidadToDisplay = 0; double COMPRA_TotalToDisplay = 0; int VENTA_CantidadToDisplay = 0; double VENTA_TotalToDisplay = 0; int TotalStockFinToDisplay = 0; double TotalFinToDisplay = 0; if (TotalStockIni.ContainsKey(e.Row.GroupLevel)) { TotalStockIniToDisplay = TotalStockIni[e.Row.GroupLevel]; TotalIniToDisplay = TotalIni[e.Row.GroupLevel]; COMPRA_CantidadToDisplay = COMPRA_Cantidad[e.Row.GroupLevel]; COMPRA_TotalToDisplay = COMPRA_Total[e.Row.GroupLevel]; VENTA_CantidadToDisplay = VENTA_Cantidad[e.Row.GroupLevel]; VENTA_TotalToDisplay = VENTA_Total[e.Row.GroupLevel]; TotalStockFinToDisplay = TotalStockFin[e.Row.GroupLevel]; TotalFinToDisplay = TotalFin[e.Row.GroupLevel]; TotalStockIni[e.Row.GroupLevel] = 0; TotalIni[e.Row.GroupLevel] = 0; COMPRA_Cantidad[e.Row.GroupLevel] = 0; COMPRA_Total[e.Row.GroupLevel] = 0; VENTA_Cantidad[e.Row.GroupLevel] = 0; VENTA_Total[e.Row.GroupLevel] = 0; TotalStockFin[e.Row.GroupLevel] = 0; TotalFin[e.Row.GroupLevel] = 0; } else { TotalStockIniToDisplay = tempTotalStockIni; TotalIniToDisplay = tempTotalIni; COMPRA_CantidadToDisplay = tempCOMPRA_Cantidad; COMPRA_TotalToDisplay = tempCOMPRA_Total; VENTA_CantidadToDisplay = tempVENTA_Cantidad; VENTA_TotalToDisplay = tempVENTA_Total; TotalStockFinToDisplay = tempTotalStockFin; TotalFinToDisplay = tempTotalFin; } // Display information in Group footer e.Row.Cells[3].Text = TotalStockIniToDisplay.ToString(); e.Row.Cells[4].Text = "S/." + TotalIniToDisplay.ToString(); e.Row.Cells[5].Text = COMPRA_CantidadToDisplay.ToString(); e.Row.Cells[6].Text = "S/." + COMPRA_TotalToDisplay.ToString(); e.Row.Cells[7].Text = VENTA_CantidadToDisplay.ToString(); e.Row.Cells[8].Text = "S/." + VENTA_TotalToDisplay.ToString(); e.Row.Cells[9].Text = TotalStockFinToDisplay.ToString(); e.Row.Cells[10].Text = "S/." + TotalFinToDisplay.ToString(); tempTotalStockIni = 0; tempTotalIni = 0; tempCOMPRA_Cantidad = 0; tempCOMPRA_Total = 0; tempVENTA_Cantidad = 0; tempVENTA_Total = 0; tempTotalStockFin = 0; tempTotalFin = 0; } }
private void btnEditar_Click(object sender, EventArgs e) { try { GridRow aux = (GridRow)dgvProcesadores.PrimaryGrid.ActiveRow; if (aux != null) { estadoComponentes(TipoVista.Modificar); procesadorOld = new Procesador(); procesador.IdProcesador = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[4])).Value.ToString()); int idTipo = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[5])).Value.ToString()); int idMarca = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[7])).Value.ToString()); //int idVelocidad = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[8])).Value.ToString()); //int idVelocidadMax = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[9])).Value.ToString()); int idGeneracion = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[6])).Value.ToString()); int activo = int.Parse(((GridCell)(((GridRow)dgvProcesadores.PrimaryGrid.ActiveRow)[3])).Value.ToString()); cmbMarca.SelectedValue = idMarca; int auxTry = int.Parse(cmbMarca.SelectedValue.ToString()); //cmbVelocidad.SelectedValue = idVelocidad; //cmbVelocidadMax.SelectedValue = idVelocidadMax; cmbGeneracion.SelectedValue = idGeneracion; chbActivo.Checked = (activo == 1) ? true : false; int i = cmbMarca.SelectedIndex; if (i >= 0) //Esto verifica que se ha seleccionado algún item del comboBox { viewTipo = new DataView(tablaTipo); viewTipo.RowFilter = "idMarca = " + idMarca.ToString(); cmbTipo.DataSource = (viewTipo.Count > 0) ? viewTipo : null; cmbTipo.DisplayMember = "nombre"; cmbTipo.ValueMember = "idModelo"; cmbTipo.SelectedIndex = (viewTipo.Count > 0) ? 0 : -1; } cmbTipo.SelectedValue = idTipo; int indice; indice = cmbTipo.SelectedIndex; procesadorOld.Modelo.IdModelo = int.Parse(cmbTipo.SelectedValue.ToString()); //procesadorOld.Modelo.NombreModelo = tablaTipo.Rows[indice]["nombre"].ToString(); indice = cmbGeneracion.SelectedIndex; procesadorOld.IdGeneracion = int.Parse(cmbGeneracion.SelectedValue.ToString()); //procesadorOld.Generacion = Convert.ToInt32(tablaGeneracion.Rows[indice]["descripcion"].ToString()); //indice = cmbVelocidad.SelectedIndex; //procesadorOld.IdVelocidad = int.Parse(cmbVelocidad.SelectedValue.ToString()); //procesadorOld.Velocidad = tablaVelocidad.Rows[indice]["descripcion"].ToString(); //indice = cmbVelocidadMax.SelectedIndex; //procesadorOld.IdVelocidadMax = int.Parse(cmbVelocidadMax.SelectedValue.ToString()); //procesadorOld.VelocidadMax = Convert.ToDouble(tablaVelocidadMax.Rows[indice]["descripcion"].ToString()); procesadorOld.Estado = activo; } } catch (Exception ex) { MessageBox.Show(ex.Message + " Comunicarse con tu soporte", "◄ AVISO | LEASEIN ►", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); estadoComponentes(TipoVista.Anular); return; } }
public void updateUserShipInfo() { GridPanel panel = pvplist.PrimaryGrid; panel.Rows.Clear(); int i = 0; if (GameData.instance.pvpOpponents == null || GameData.instance.pvpOpponents.Count == 0) { return; } foreach (var us in GameData.instance.pvpOpponents) { object[] vals = new object[5]; vals[0] = us.uid; vals[1] = us.username; vals[2] = us.level; vals[3] = getpvptstring(us); vals[4] = us.resultLevel == WarResultLevel.none ? "挑战" : us.resultLevel.ToString(); GridRow gr = new GridRow(vals); gr.RowHeight = 100; panel.Rows.Add(gr); i++; } }
private void FillGrid() { table = EhrPatListElements.GetListOrderBy2014(elementList); int colWidth = 0; Graphics g = CreateGraphics(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; col = new GridColumn("PatNum", 60, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.AmountParse; gridMain.ListGridColumns.Add(col); col = new GridColumn("Full Name", 200); col.SortingStrategy = GridSortingStrategy.StringCompare; gridMain.ListGridColumns.Add(col); for (int i = 0; i < elementList.Count; i++) { switch (elementList[i].Restriction) { case EhrRestrictionType.Birthdate: col = new GridColumn("Birthdate", 80, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); col = new GridColumn("Age", 80, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.AmountParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Gender: col = new GridColumn("Gender", 80, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.LabResult: colWidth = System.Convert.ToInt32(g.MeasureString("Lab Value: " + elementList[i].CompareString, this.Font).Width); col.SortingStrategy = GridSortingStrategy.AmountParse; colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Lab Value: " + elementList[i].CompareString, colWidth, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); colWidth = System.Convert.ToInt32(g.MeasureString("Lab Date: " + elementList[i].CompareString, this.Font).Width); colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Lab Date: " + elementList[i].CompareString, colWidth, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Medication: colWidth = System.Convert.ToInt32(g.MeasureString("Prescription Date: " + elementList[i].CompareString, this.Font).Width); colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Prescription Date: " + elementList[i].CompareString, colWidth, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Problem: colWidth = System.Convert.ToInt32(g.MeasureString("Date Diagnosed: " + DiseaseDefs.GetNameByCode(elementList[i].CompareString), this.Font).Width); colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Date Diagnosed: " + DiseaseDefs.GetNameByCode(elementList[i].CompareString), colWidth, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Allergy: colWidth = System.Convert.ToInt32(g.MeasureString("Date Alergic Reaction: " + elementList[i].CompareString, this.Font).Width); colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Date Alergic Reaction: " + elementList[i].CompareString, colWidth, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.CommPref: col = new GridColumn("Communication Preference", 180, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); break; } } // colWidth=System.Convert.ToInt32(g.MeasureString(elementList[i].CompareString,this.Font).Width); // colWidth=colWidth+(colWidth/10);//Add 10% // if(colWidth<90) { // colWidth=90;//Minimum of 90 width. // } gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < table.Rows.Count; i++) { row = new GridRow(); row.Cells.Add(table.Rows[i]["PatNum"].ToString()); row.Cells.Add(table.Rows[i]["LName"].ToString() + ", " + table.Rows[i]["FName"].ToString()); //Add 3 to j to compensate for PatNum, LName and FName. int k = 0; //added to j to iterate through the table columns as j itterates through the elementList for (int j = 0; j < elementList.Count; j++) //sometimes one element might pull two columns, Lab Results for instance.//<elementList.Count;j++) { { switch (elementList[j].Restriction) { case EhrRestrictionType.Medication: case EhrRestrictionType.Problem: case EhrRestrictionType.Allergy: row.Cells.Add(table.Rows[i][j + k + 3].ToString().Replace(" 12:00:00 AM", "")); //safely remove irrelevant time entries.//dates break; case EhrRestrictionType.Birthdate: row.Cells.Add(table.Rows[i][j + k + 3].ToString().Replace(" 12:00:00 AM", "")); //safely remove irrelevant time entries.//date row.Cells.Add(table.Rows[i][j + k + 4].ToString()); //age k++; //to keep the count correct. break; case EhrRestrictionType.LabResult: row.Cells.Add(table.Rows[i][j + k + 3].ToString()); //obsVal row.Cells.Add(table.Rows[i][j + k + 4].ToString().Replace(" 12:00:00 AM", "")); //safely remove irrelevant time entries.//date k++; //to keep the count correct. break; case EhrRestrictionType.Gender: switch (table.Rows[i][j + k + 3].ToString()) { case "0": //Male row.Cells.Add("Male"); break; case "1": //Female row.Cells.Add("Female"); break; case "2": //Unknown default: row.Cells.Add("Unknown"); break; } break; case EhrRestrictionType.CommPref: switch (table.Rows[i][j + k + 3].ToString()) { case "0": //None row.Cells.Add("None"); break; case "1": //DoNotCall row.Cells.Add("Do Not Call"); break; case "2": //HmPhone row.Cells.Add("Home Phone"); break; case "3": //WkPhone row.Cells.Add("Work Phone"); break; case "4": //WirelessPh row.Cells.Add("Wireless Phone"); break; case "5": //Email row.Cells.Add("Email"); break; case "6": //SeeNotes row.Cells.Add("See Notes"); break; case "7": //Mail row.Cells.Add("Mail"); break; case "8": //TextMessage row.Cells.Add("TextMessage"); break; } break; } } gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); g.Dispose(); }
private void FillGrid() { long provNum; if (!long.TryParse(textProvNum.Text, out provNum)) { provNum = 0; } long classNum = 0; if (IsStudentPicker) { classNum = _schoolClasses[comboClass.SelectedIndex].SchoolClassNum; } List <Provider> listProvs; if (_listProviders != null && !checkShowAll.Checked) //User wants to use a specific list of providers. { listProvs = _listProviders; } else { listProvs = Providers.GetFilteredProviderList(provNum, textLName.Text, textFName.Text, classNum); } gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; if (!PrefC.GetBool(PrefName.EasyHideDentalSchools)) { col = new GridColumn(Lan.g("TableProviders", "ProvNum"), 60); gridMain.ListGridColumns.Add(col); } col = new GridColumn(Lan.g("TableProviders", "Abbrev"), 80); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableProviders", "LName"), 100); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableProviders", "FName"), 100); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < listProvs.Count; i++) { if (IsStudentPicker && listProvs[i].SchoolClassNum == 0) { continue; } row = new GridRow(); if (!PrefC.GetBool(PrefName.EasyHideDentalSchools)) { row.Cells.Add(listProvs[i].ProvNum.ToString()); } row.Cells.Add(listProvs[i].Abbr); row.Cells.Add(listProvs[i].LName); row.Cells.Add(listProvs[i].FName); row.Tag = listProvs[i].ProvNum; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
private void InitGrid() { GridPanel panel = superGrid.PrimaryGrid; try { SysDictDAC dacSys = new SysDictDAC(); List <SysDictEntity> lstDict = dacSys.SelectList("deliveryspec"); if (lstDict.Count > 0) { string[] specArray = new string[lstDict.Count]; int i = 0; foreach (SysDictEntity entity in lstDict) { specArray[i] = entity.dictvalue; i++; } panel.Columns["specifications"].EditorType = typeof(FragrantComboBox); panel.Columns["specifications"].EditorParams = new object[] { specArray }; } } catch (Exception ex) { MessageBox.Show("提取字典出错,请检查网络是否异常!\r\n原因如下:" + ex.Message); } if (objNote != null & EditMode > 0) { if (EditMode == 2) { noteid.Text = objNote.noteid.ToString(); deliverid.Text = objNote.deliverid.ToString().PadLeft(3, '0'); customer.Enabled = false; } customer.Text = objNote.customer; model.Text = objNote.model; deliverdate.Value = objNote.deliverdate; goodname.Text = objNote.goodname; batch.Text = objNote.batch; description.Text = objNote.description; description1.Text = objNote.description1; if (objNote.items != null) { foreach (DeliveryItem item in objNote.items) { GridRow newRow = new GridRow( item.jiannum, item.specifications, item.lenght, item.discnum, item.weight, Math.Round(item.price, 5), Math.Round(item.totalprice, 5), item.contractno, item.netweight, item.coreweight ); panel.Rows.Add(newRow); } } } }
private static GridRow CreateRow(Grouping grouping, Object o, int indent) { IXenObject ixmo = o as IXenObject; if (ixmo != null) { bool isFolderRow = (o is Folder); GridRow _row = NewGroupRow(ixmo.opaque_ref, ixmo, isFolderRow ? FOLDER_ROW_HEIGHT : ROW_HEIGHT, 0); foreach (ColumnNames column in Enum.GetValues(typeof(ColumnNames))) { GridItemBase item = ColumnAccessors.Get(column).GetGridItem(ixmo); if (item != null) { if (column == XenAdmin.XenSearch.ColumnNames.name) { EventHandler onDoubleClickDelegate = isFolderRow ? (EventHandler) delegate { Program.MainWindow.DoSearch(Search.SearchForFolder(ixmo.opaque_ref)); } : (EventHandler) delegate { if (Program.MainWindow.SelectObject(ixmo) && Program.MainWindow.TheTabControl.TabPages.Contains(Program.MainWindow.TabPageGeneral)) { Program.MainWindow.SwitchToTab(MainWindow.Tab.Settings); } }; GridImageItem _statusItem = new GridImageItem( "foo", new ImageDelegate(delegate() { return(Images.GetImage16For(ixmo)); }), HorizontalAlignment.Left, VerticalAlignment.Top, true, onDoubleClickDelegate); _row.AddItem("name", NewNameItem(_statusItem, item, 16, indent)); } else { _row.AddItem(column.ToString(), item); } } } AddCustomFieldsToRow(ixmo, _row); return(_row); } if (grouping == null) { return(null); } GridRow row = NewGroupRow(String.Format("{0}: {1}", grouping.GroupingName, o), null, ROW_HEIGHT, 0); GridImageItem statusItem = new GridImageItem( grouping.GroupingName, new ImageDelegate(delegate() { return(Images.GetImage16For(grouping.GetGroupIcon(o))); }), HorizontalAlignment.Left, VerticalAlignment.Top, true); GridVerticalArrayItem nameItem = NewDoubleRowItem(grouping, o); row.AddItem("name", NewNameItem(statusItem, nameItem, 16, indent)); return(row); }
private void updateDisList() { GridPanel panel = dislist.PrimaryGrid; panel.Rows.Clear(); var dlist = tools.configmng.instance.getDisEquipList(); foreach (var cid in dlist.Keys) { try { EquipmentConfig ec = GameConfigs.instance.GetEquipmentByCid(int.Parse(cid)); List<int> vallist = new List<int> { ec.atk, ec.torpedo, ec.aircraftAtk, ec.airDef, ec.antisub, ec.radar, ec.hit, ec.miss, ec.range, ec.luck, ec.def }; string[] props = new string[4] { "", "", "","" }; int count = 0; for (int j = 0; (j < vallist.Count) && (count < 4); j++) { if (vallist[j] != 0) { props[count] = tools.helper.getShipProptypestring(type_order_list[j]) + ":" + tools.helper.getShipProptypeval(type_order_list[j], vallist[j]); count++; } } if (ec != null) { object[] vals = new object[6]; vals[0] = tools.helper.getstartstring(ec.star); vals[1] = tools.helper.getEquipmentTypeString(ec.type); vals[2] = ec.title + "\r\n" + props[0] + "\r\n" + props[1] + "\r\n" + props[2] + "\r\n" + props[3]; vals[3] = tools.helper.getEquipmentImage(ec); vals[4] = "移除"; vals[5] = ec.cid; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 90; } }catch(Exception e) { } } }
private void FillGrid() { table = EhrPatListElements.GetListOrderBy2014Retro(elementList); int colWidth = 0; Graphics g = CreateGraphics(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; col = new GridColumn("PatNum", 60, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.AmountParse; gridMain.ListGridColumns.Add(col); col = new GridColumn("Full Name", 200); col.SortingStrategy = GridSortingStrategy.StringCompare; gridMain.ListGridColumns.Add(col); for (int i = 0; i < elementList.Count; i++) { if (orderByColumn == -1 && elementList[i].OrderBy) { //There can be 0 to 1 elements that have OrderBy set to true. //we will use this to determine how to use the ASC/DESC buttons. //some elements add one column, others add two, this selects the column that is to be added next. orderByColumn = gridMain.ListGridColumns.Count; } switch (elementList[i].Restriction) { case EhrRestrictionType.Birthdate: col = new GridColumn("Birthdate", 80, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.DateParse; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Gender: col = new GridColumn("Gender", 80, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.LabResult: colWidth = System.Convert.ToInt32(g.MeasureString("Lab Value: " + elementList[i].CompareString, this.Font).Width); col.SortingStrategy = GridSortingStrategy.AmountParse; colWidth = colWidth + (colWidth / 10); //Add 10% col = new GridColumn("Lab Value: " + elementList[i].CompareString, colWidth, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Medication: col = new GridColumn("Medication", 90, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.StringCompare; gridMain.ListGridColumns.Add(col); break; case EhrRestrictionType.Problem: col = new GridColumn("Disease", 160, HorizontalAlignment.Center); col.SortingStrategy = GridSortingStrategy.StringCompare; gridMain.ListGridColumns.Add(col); break; default: //should not happen. break; } } gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < table.Rows.Count; i++) { row = new GridRow(); row.Cells.Add(table.Rows[i]["PatNum"].ToString()); row.Cells.Add(table.Rows[i]["LName"].ToString() + ", " + table.Rows[i]["FName"].ToString()); //Add 3 to j to compensate for PatNum, LName and FName. for (int j = 0; j < elementList.Count; j++) //sometimes one element might pull two columns, Lab Results for instance.//<elementList.Count;j++) { { switch (elementList[j].Restriction) { case EhrRestrictionType.Medication: case EhrRestrictionType.Problem: row.Cells.Add(table.Rows[i][j + 3].ToString()); break; case EhrRestrictionType.Birthdate: row.Cells.Add(table.Rows[i][j + 3].ToString().Replace(" 12:00:00 AM", "")); break; case EhrRestrictionType.LabResult: row.Cells.Add(table.Rows[i][j + 3].ToString()); //obsVal break; case EhrRestrictionType.Gender: switch (table.Rows[i][j + 3].ToString()) { case "0": //Male row.Cells.Add("Male"); break; case "1": //Female row.Cells.Add("Female"); break; case "2": //Unknown default: row.Cells.Add("Unknown"); break; } break; } } gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); g.Dispose(); }
internal void tryaddtodis(int rowindex, int equipcid) { GridPanel p = nondislist.PrimaryGrid; int cid = (int)p.GetCell(rowindex, 5).Value; EquipmentConfig ec = GameConfigs.instance.GetEquipmentByCid(cid); if (cid == equipcid) { object[] vals = new object[6]; vals[0] = p.GetCell(rowindex, 1).Value; vals[1] = p.GetCell(rowindex, 2).Value; vals[2] = p.GetCell(rowindex, 3).Value; vals[3] = tools.helper.getEquipmentImage(ec); vals[4] = "移除"; vals[5] = cid; GridRow gr = new GridRow(vals); dislist.PrimaryGrid.Rows.Add(gr); gr.RowHeight = 90; p.Rows.Remove(p.Rows[rowindex]); } //var sc = AllShipConfigs.instance.getShip(cid); tools.configmng.instance.adddisequip(cid, tools.helper.getstartstring(ec.star)+ " " + ec.title); //EditorCell.GridRow.Cells[1].CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(s == "吃掉" ? Color.White : Color.LightGreen); }
private void ProjectGrid_RowHeaderDoubleClick(object sender, GridRowHeaderDoubleClickEventArgs e) { GridPanel panel = ProjectGrid.PrimaryGrid; GridRow row = (GridRow)panel.Rows[e.GridRow.RowIndex]; row.Rows.Clear(); int id = (int)row.Cells["gcId"].Value; using (SQLiteConnection conn = new SQLiteConnection(DataSourceManager.DataSource)) { conn.Open(); SQLiteCommand cmd = new SQLiteCommand(); cmd.Connection = conn; try { string Id = row.Cells[0].Value.ToString(); string strsql = string.Format("select * from ArchiveInfo where ProjectId={0} order by ArchDate desc", id); cmd.CommandText = strsql; SQLiteDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { GridPanel subPanel = new GridPanel(); SetArchivePanelColumn(subPanel); while (reader.Read()) { ArchiveInfo ai = new ArchiveInfo(); ai.Id = reader.GetInt16(0); ai.ArchiveName = reader.GetString(1); ai.ArchType = reader.GetString(2); if (!reader.IsDBNull(3)) { ai.ArchDate = Convert.ToDateTime(reader.GetString(3)); } ai.DispatchNum = reader.IsDBNull(4) ? "" : reader.GetString(4); ai.Copies = reader.GetInt16(5); ai.Remaining = reader.GetInt16(6); ai.StorageLocation = reader.IsDBNull(7) ? "" : reader.GetString(7); ai.Handler = reader.IsDBNull(8) ? "" : reader.GetString(8); GridRow gr = new GridRow(); gr.Cells.Add(new GridCell(ai.ArchiveName)); gr.Cells.Add(new GridCell(ai.Id)); gr.Cells.Add(new GridCell(ai.ArchType)); if (ai.ArchDate != null) { gr.Cells.Add(new GridCell(ai.ArchDate.ToString()));//"yyyy-MM-dd" } gr.Cells.Add(new GridCell(ai.DispatchNum)); gr.Cells.Add(new GridCell(ai.Copies)); gr.Cells.Add(new GridCell(ai.Remaining)); gr.Cells.Add(new GridCell(ai.StorageLocation)); gr.Cells.Add(new GridCell(ai.Handler)); subPanel.Rows.Add(gr); } e.GridRow.Rows.Add(subPanel); } } catch (System.Data.SQLite.SQLiteException E) { throw new Exception(E.Message); } } }
private string CheckForm(out bool saveInsert) { string sRet = ""; saveInsert = false; if (customer.Text.Length == 0) { sRet = "请输入客户名称"; return(sRet); } GridPanel panel = superGrid.PrimaryGrid; if (panel.Rows.Count > 0) { for (int i = 0; i < panel.Rows.Count; i++) { GridRow curRow = panel.Rows[i] as GridRow; string sJianNum = ControlHelper.Object2String(curRow["jiannum"].Value); string sSpec = ControlHelper.Object2String(curRow["specifications"].Value); int iLength = ControlHelper.Object2Int(curRow["lenght"].Value); int iDiscNum = ControlHelper.Object2Int(curRow["discnum"].Value); double dWeight = ControlHelper.Object2Double(curRow["weight"].Value); double dPrice = ControlHelper.Object2Double(curRow["price"].Value); string sContact = ControlHelper.Object2String(curRow["contractno"].Value); double dNetWeight = ControlHelper.Object2Double(curRow["netweight"].Value); double dCoreWeight = ControlHelper.Object2Double(curRow["coreweight"].Value); bool bCheck = false; if (curRow.IsInsertRow) { if (sContact.Length > 0 || dPrice > 0 || dWeight > 0 || iDiscNum > 0 || iLength > 0 || sSpec.Length > 0 || dCoreWeight > 0 || dNetWeight > 0) { bCheck = true; saveInsert = true; } } else { bCheck = true; } if (bCheck) { if (sJianNum.Length == 0) { sRet = "请输入第" + (i + 1) + "行的件号"; break; } if (sSpec.Length == 0) { sRet = "请输入第" + (i + 1) + "行的规格"; break; } if (iLength == 0) { sRet = "请输入第" + (i + 1) + "行的长度"; break; } if (iDiscNum == 0) { sRet = "请输入第" + (i + 1) + "行的盘数"; break; } if (dWeight == 0) { sRet = "请输入第" + (i + 1) + "行的净重"; break; } if (dCoreWeight == 0) { sRet = "请输入第" + (i + 1) + "行的管芯"; break; } } } } return(sRet); }
private void updateNonDisList() { GridPanel panel = nondislist.PrimaryGrid; panel.Rows.Clear(); var dlist = tools.configmng.instance.getDisEquipList(); foreach (var eckv in GameConfigs.instance.AllEquipmentConfig) { var ec = eckv.Value; if (ec != null && dlist.ContainsKey(ec.cid.ToString()) == false) { List<int> vallist = new List<int> { ec.atk, ec.torpedo, ec.aircraftAtk, ec.airDef, ec.antisub, ec.radar, ec.hit, ec.miss, ec.range, ec.luck, ec.def }; string[] props = new string[4] { "", "","","" }; int count = 0; for (int j = 0; (j < vallist.Count) && (count < 4); j++) { if (vallist[j] != 0) { props[count] = tools.helper.getShipProptypestring(type_order_list[j]) + ":" + tools.helper.getShipProptypeval(type_order_list[j], vallist[j]); count++; } } object[] vals = new object[6]; vals[0] = "添加"; vals[1] = tools.helper.getstartstring(ec.star); vals[2] = tools.helper.getEquipmentTypeString(ec.type); vals[3] = ec.title + "\r\n" + props[0] + "\r\n" + props[1] + "\r\n" + props[2] + "\r\n" + props[3]; vals[4] = tools.helper.getEquipmentImage(ec); vals[5] = ec.cid; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 60; } } }
private void btnRegisterProject_Click(object sender, EventArgs e) { GridRow gr = ProjectGrid.PrimaryGrid.NewRow(); ProjectGrid.PrimaryGrid.Rows.Add(gr); }
/// <summary> /// To analyze. /// </summary> protected override void OnAnalyze() { var chart = Chart; var grid = Grid; var chartSeries = new XyzDataSeries<DateTime, double, double>(); ThreadSafeObservableCollection<GridRow> gridSeries = null; chart.GuiSync(() => { // очищаем данные с предыдущего запуска скрипта chart.RenderableSeries.Clear(); grid.Columns.Clear(); chart.RenderableSeries.Add(new FastBubbleRenderableSeries { ResamplingMode = ResamplingMode.Auto, BubbleColor = Colors.Chocolate, ZScaleFactor = 0.1, AutoZRange = true, DataSeries = chartSeries }); chart.XAxis = new DateTimeAxis { GrowBy = new DoubleRange(0.0, 0.1) }; chart.YAxis = new NumericAxis { GrowBy = new DoubleRange(0.1, 0.1) }; grid.AddTextColumn("Time", LocalizedStrings.Time).Width = 150; var volumeColumn = grid.AddTextColumn("Volume", LocalizedStrings.Volume); volumeColumn.Width = 100; var gridSource = new ObservableCollectionEx<GridRow>(); grid.ItemsSource = gridSource; gridSeries = new ThreadSafeObservableCollection<GridRow>(gridSource); grid.SetSort(volumeColumn, ListSortDirection.Descending); }); // получаем хранилище свечек var storage = StorateRegistry.GetCandleStorage(typeof(TimeFrameCandle), Security, TimeFrame, format: StorageFormat); // получаем набор доступных дат за указанный период var dates = storage.GetDates(From, To).ToArray(); var rows = new Dictionary<TimeSpan, GridRow>(); foreach (var loadDate in dates) { // проверяем флаг остановки if (ProcessState != ProcessStates.Started) break; // загружаем свечки var candles = storage.Load(loadDate); // группируем свечки по часовой отметке времени var groupedCandles = candles.GroupBy(c => c.OpenTime.TimeOfDay.Truncate(TimeSpan.FromHours(1))); foreach (var group in groupedCandles.OrderBy(g => g.Key)) { // проверяем флаг остановки if (ProcessState != ProcessStates.Started) break; var time = group.Key; // получаем суммарный объем в пределах часовой отметки var sumVol = group.Sum(c => c.TotalVolume); var row = rows.TryGetValue(time); if (row == null) { // пришел новый уровень - добавляем новую запись rows.Add(time, row = new GridRow { Time = time, Volume = sumVol }); // выводим на график chartSeries.Append(DateTime.Today + time, (double)sumVol, (double)sumVol / 1000); // выводит в таблицу gridSeries.Add(row); } else { // увеличиваем суммарный объем row.Volume += sumVol; // обновляем график chartSeries.Update(DateTime.Today + time, (double)row.Volume, (double)row.Volume / 1000); } } chart.GuiAsync(() => { // обновление сортировки в таблице grid.RefreshSort(); // автомасштабирование графика chart.ZoomExtents(); }); } // оповещаем программу об окончании выполнения скрипта base.Stop(); }
private void LaunchViewer(List <IProcess> selectedProcesses) { // Single process only if (selectedProcesses != null && selectedProcesses.Count != 1) { return; } IProcess proc = selectedProcesses[0]; int procID = proc.ProcessID; // Create the application's main window m_mainWindow = new Window(); m_mainWindow.Title = String.Format(FullTitle, proc.Name, procID); // HelpBox m_helpBox = new TextBox(); m_helpBox.TextWrapping = TextWrapping.Wrap; m_helpBox.Foreground = Brushes.Blue; m_statusBar = new StatusBar(); m_statusBar.Height = 24; // GCInfoView Panel GcInfoView gcinfo = new GcInfoView(); // Grid for 5 panels with adjustable heights Grid grid = new Grid(); m_gcInfoPanel = new GridRow(grid, gcinfo.CreateGCInfoPanel(m_helpBox).Wrap(GCEventPanelName), true, true, 0, 111); // HeapTickView Panel HeapAllocView heapAlloc = new HeapAllocView(); m_heapAllocPanel = new GridRow(grid, heapAlloc.CreateHeapAllocPanel(m_traceLog).Wrap(AllocTickPanelName), false, true, 1, 111); // Thread Panel ThreadView threadView = new ThreadView(); m_threadPanel = new GridRow(grid, threadView.CreateThreadViewPanel().Wrap(ThreadPanelName), false, true, 2, 111); // Issue Panel IssueView issue = new IssueView(); m_issuePanel = new GridRow(grid, issue.CreateIssuePanel(m_helpBox).Wrap(IssuePanelName), false, true, 3, 111); // HeapDiagram Panel HeapDiagram diagram = new HeapDiagram(m_dataFile, m_statusBar, m_mainWindow); m_heapDiagramPanel = new GridRow(grid, diagram.CreateHeapDiagramPanel(m_helpBox).Wrap(HeapDiagramPanelName), true, false, 4, 111); DockPanel main = new DockPanel(); main.DockBottom(m_statusBar); main.DockTop(CreateMainMenu()); main.DockBottom(grid); m_mainWindow.Content = main; m_mainWindow.Closed += CloseMainWindow; m_mainWindow.Show(); // Load events for the process m_heapInfo = new ProcessMemoryInfo(m_traceLog, m_dataFile, m_statusBar); m_statusBar.StartWork(String.Format("Loading events for process {0} (pid={1})", proc.Name, procID), delegate() { m_heapInfo.LoadEvents(procID, (int)m_traceLog.SampleProfileInterval.Ticks); m_statusBar.EndWork(delegate() { gcinfo.SetGCEvents(m_heapInfo.GcEvents); heapAlloc.SetAllocEvents(m_heapInfo.m_allocSites); threadView.SetData(m_heapInfo); diagram.SetData(m_heapInfo); issue.SetData(m_heapInfo); }); }); }
private void updateNodeList(bool viewbywintype) { string url = tools.helper.count_server_addr + "/analyze/" + (viewbywintype ? "weapon/weaponlist" : "ship/shiplist") + ".json"; try { var response = p.GetAsync(url).Result; response.EnsureSuccessStatusCode(); var content = response.Content.ReadAsByteArrayAsync().Result; string ss = System.Text.Encoding.UTF8.GetString(content); NodeList list = new JsonFx.Json.JsonReader().Read<NodeList>(ss); GridPanel p1 = this.droplist.PrimaryGrid; p1.Rows.Clear(); GridPanel panel = nodelist.PrimaryGrid; panel.Rows.Clear(); foreach (var cl in list.nodelist) { object[] vals = new object[6]; vals[0] = cl.name; vals[1] = cl.count; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 20; } } catch (Exception) { } }
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]); //} }
private static void AddCustomFieldsToRow(IXenObject o, GridRow row) { foreach (CustomFieldDefinition customFieldDefinition in CustomFieldsManager.GetCustomFields()) { GridStringItem customFieldItem = new GridStringItem( new CustomFieldWrapper(o, customFieldDefinition), HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, TextBrush, Program.DefaultFont, new EventHandler(delegate { using (PropertiesDialog dialog = new PropertiesDialog(o)) { dialog.SelectCustomFieldsEditPage(); dialog.ShowDialog(); } })); row.AddItem(CustomFieldsManager.CUSTOM_FIELD + customFieldDefinition.Name, customFieldItem); } }
/// <summary> /// Grid点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Grid4_RowCommand(object sender, FineUI.GridCommandEventArgs e) { GridRow gr = Grid4.Rows[e.RowIndex]; //获取当前点击列的主键ID int id_public = int.Parse(gr.DataKeys[0].ToString()); switch (e.CommandName) { case "IsOrNotLink": string id_menu = GridViewHelper.GetSelectedKey(Grid3, true); //获取未分配的 勾选的Id if (Grid3.SelectedRowIndexArray.Length > 1 || Grid3.SelectedRowIndexArray.Length == 0) { Alert.Show("请选择一行!", MessageBoxIcon.Warning); break; } //更新状态 // MenuInfoBll.GetInstence().UpdateIsDisplay(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument)); if (e.CommandArgument == "0") { //删除PagePowerSign if (Grid3.SelectedRowIndexArray.Length == 0) { Alert.Show("请搜选菜单项!", MessageBoxIcon.Information); } GridRow gr1 = Grid3.Rows[Grid3.SelectedRowIndex]; menuInfoId_ = int.Parse(gr1.Values[0].ToString()); var model1 = new Solution.DataAccess.DataModel.PagePowerSignPublic(x => x.Id == id_public); var model_p = PagePowerSign.SingleOrDefault(x => x.PagePowerSignPublic_Id == model1.Id && x.MenuInfo_Id == menuInfoId); // PagePowerSignBll.GetInstence().GetModel(model1.Id, menuInfoId_, true); //获取PagePowerSign表 PagePowerSignBll.GetInstence().Delete(this, model_p.Id); int id = ConvertHelper.Cint0(hidId.Text); //获取页面传值 var model = new DataAccess.Model.Position(); //获取指定ID的菜单内容,如果不存在,则创建一个菜单实体 model = PositionBll.GetInstence().GetModelForCache(x => x.Id == id); string new_control = model.ControlPower.Replace(id_menu + "|" + id_public + ",", ""); // model.ControlPower = new_control; PositionBll.GetInstence().UpdateValue(this, id, "ControlPower", new_control, "", true, false); //.UpdateControlPower(this, id, new_control, false, false); // PositionBll.GetInstence().SetModelForCache(model); } else //添加PagePowerSign //Solution.DataAccess.Model.PagePowerSign model = new DataAccess.Model.PagePowerSign(); //model.PagePowerSignPublic_Id = (int)id; //model.CName = { var model1 = new Solution.DataAccess.DataModel.PagePowerSignPublic(x => x.Id == id_public); Solution.DataAccess.DataModel.PagePowerSign pps = new DataAccess.DataModel.PagePowerSign(); pps.PagePowerSignPublic_Id = model1.Id; pps.CName = model1.Cname; pps.EName = model1.Ename; pps.MenuInfo_Id = int.Parse(id_menu); PagePowerSignBll.GetInstence().Save(this, pps); int id = ConvertHelper.Cint0(hidId.Text); //获取页面传值 var model = new DataAccess.Model.Position(); //获取指定ID的菜单内容,如果不存在,则创建一个菜单实体 model = PositionBll.GetInstence().GetModelForCache(x => x.Id == id); string new_control = model.ControlPower + id_menu + "|" + id_public + ","; //model.ControlPower = new_control; PositionBll.GetInstence().UpdateValue(this, id, "ControlPower", new_control, "", true, false); //PositionBll.GetInstence().UpdateControlPower(this, id, new_control, false, false); //PositionBll.GetInstence().SetModelForCache(model); } //重新加载 conditionList = new List <ConditionFun.SqlqueryCondition>(); conditionList.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, "1", Comparison.Equals, "1", false, false)); //bll.BindGrid(Grid1, 0, sortList); bll.BindGrid(Grid4, 0, 0, conditionList, sortList); break; } }
private void AddNoResultsRow() { GridRow row = new GridRow(ROW_HEIGHT); GridStringItem resultsItem = new GridStringItem(Messages.OVERVIEW_NO_RESULTS, HorizontalAlignment.Left, VerticalAlignment.Middle, false, false, TextBrush, Program.DefaultFont, 6); row.AddItem("name", resultsItem); AddRow(row); }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn("Code", 70); gridMain.ListGridColumns.Add(col); col = new GridColumn("CodeSystem", 90); gridMain.ListGridColumns.Add(col); col = new GridColumn("Description", 200); gridMain.ListGridColumns.Add(col); string selectedValue = comboCodeSet.SelectedItem.ToString(); List <string> listValSetOIDs = new List <string>(); if (selectedValue == "All") { listValSetOIDs = new List <string>(dictValueCodeSets.Values); } else //this will limit the codes to only one value set oid { listValSetOIDs.Add(dictValueCodeSets[selectedValue]); } listCodes = EhrCodes.GetForValueSetOIDs(listValSetOIDs, true); //these codes will exist in the corresponding table or will not be in the list gridMain.ListGridRows.Clear(); GridRow row; int selectedIdx = -1; for (int i = 0; i < listCodes.Count; i++) { row = new GridRow(); row.Cells.Add(listCodes[i].CodeValue); row.Cells.Add(listCodes[i].CodeSystem); //Retrieve description from the associated table string descript = ""; switch (listCodes[i].CodeSystem) { case "CPT": Cpt cCur = Cpts.GetByCode(listCodes[i].CodeValue); if (cCur != null) { descript = cCur.Description; } break; case "HCPCS": Hcpcs hCur = Hcpcses.GetByCode(listCodes[i].CodeValue); if (hCur != null) { descript = hCur.DescriptionShort; } break; case "ICD9CM": ICD9 i9Cur = ICD9s.GetByCode(listCodes[i].CodeValue); if (i9Cur != null) { descript = i9Cur.Description; } break; case "ICD10CM": Icd10 i10Cur = Icd10s.GetByCode(listCodes[i].CodeValue); if (i10Cur != null) { descript = i10Cur.Description; } break; case "RXNORM": descript = RxNorms.GetDescByRxCui(listCodes[i].CodeValue); break; case "SNOMEDCT": Snomed sCur = Snomeds.GetByCode(listCodes[i].CodeValue); if (sCur != null) { descript = sCur.Description; } break; } row.Cells.Add(descript); gridMain.ListGridRows.Add(row); if (listCodes[i].CodeValue == InterventionCur.CodeValue && listCodes[i].CodeSystem == InterventionCur.CodeSystem) { selectedIdx = i; } } gridMain.EndUpdate(); if (selectedIdx > -1) { gridMain.SetSelected(selectedIdx, true); gridMain.ScrollToIndex(selectedIdx); } }
public RowGroupAcceptor(GridRow gridRow) { _gridRow = gridRow; }
private void FillExistingGrid() { gridAllergyExisting.BeginUpdate(); gridAllergyExisting.ListGridColumns.Clear(); GridColumn col = new GridColumn("Last Modified", 90, HorizontalAlignment.Center); gridAllergyExisting.ListGridColumns.Add(col); col = new GridColumn("Description", 200); gridAllergyExisting.ListGridColumns.Add(col); col = new GridColumn("Reaction", 100); gridAllergyExisting.ListGridColumns.Add(col); col = new GridColumn("Inactive", 80, HorizontalAlignment.Center); gridAllergyExisting.ListGridColumns.Add(col); gridAllergyExisting.ListGridRows.Clear(); _listAllergyCur = Allergies.GetAll(_patCur.PatNum, false); List <long> allergyDefNums = new List <long>(); for (int h = 0; h < _listAllergyCur.Count; h++) { if (_listAllergyCur[h].AllergyDefNum > 0) { allergyDefNums.Add(_listAllergyCur[h].AllergyDefNum); } } _listAllergyDefCur = AllergyDefs.GetMultAllergyDefs(allergyDefNums); GridRow row; AllergyDef ald; for (int i = 0; i < _listAllergyCur.Count; i++) { row = new GridRow(); ald = new AllergyDef(); ald = AllergyDefs.GetOne(_listAllergyCur[i].AllergyDefNum, _listAllergyDefCur); row.Cells.Add(_listAllergyCur[i].DateTStamp.ToShortDateString()); if (ald.Description == null) { row.Cells.Add(""); } else { row.Cells.Add(ald.Description); } if (_listAllergyCur[i].Reaction == null) { row.Cells.Add(""); } else { row.Cells.Add(_listAllergyCur[i].Reaction); } if (_listAllergyCur[i].StatusIsActive) { row.Cells.Add(""); } else { row.Cells.Add("X"); } gridAllergyExisting.ListGridRows.Add(row); } gridAllergyExisting.EndUpdate(); }
private void updateExploreInfo() { Dictionary<int, int> explist = new Dictionary<int, int>(); foreach (var expl in GameData.instance.GetUserPVEExplores()) { explist[expl.exploreId] = expl.fleetId; } GridPanel panel = explorelist.PrimaryGrid; panel.Rows.Clear(); int i = 0; foreach (KeyValuePair<int, PVEExploreLevelConfig> kv in GameConfigs.instance.getallExploreLevels()) { int key = kv.Key; PVEExploreLevelConfig conf = kv.Value; object[] vals = new object[12]; vals[0] = conf.id; vals[1] = conf.title; vals[2] = getrewardstring(conf); vals[3] = conf.TimeNeed; vals[4] = conf.needShipNum; vals[5] = conf.needFlagShipLevel; vals[6] = gettyperequiredstring(conf); vals[7] = getrandawardstring(conf); vals[8] = "%" + conf.bigSuccessRate; vals[9] = getoilammocost(conf); vals[10] = false; vals[11] = "执行"; GridRow gr = new GridRow(vals); gr.RowHeight = 0; panel.Rows.Add(gr); panel.GetCell(i, 11).Tag = conf.id; if (explist.ContainsKey(conf.id)) { panel.GetCell(i, 10).Visible = false; panel.GetCell(i, 11).Visible = false; int flid = explist[conf.id]; var uf = GameData.instance.UserFleets[flid - 1]; panel.GetCell(i, 2).Value = uf.title + " 正在执行中..."; panel.GetCell(i, 2).CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(Color.LightGreen); var r = panel.GetRowFromIndex(i); if(r!= null) { r.CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(Color.LightGreen); } } i++; } }
private void FillReconcileGrid() { gridAllergyReconcile.BeginUpdate(); gridAllergyReconcile.ListGridColumns.Clear(); GridColumn col = new GridColumn("Last Modified", 90, HorizontalAlignment.Center); gridAllergyReconcile.ListGridColumns.Add(col); col = new GridColumn("Description", 400); gridAllergyReconcile.ListGridColumns.Add(col); col = new GridColumn("Reaction", 300); gridAllergyReconcile.ListGridColumns.Add(col); col = new GridColumn("Inactive", 80, HorizontalAlignment.Center); gridAllergyReconcile.ListGridColumns.Add(col); col = new GridColumn("Is Incoming", 100, HorizontalAlignment.Center); gridAllergyReconcile.ListGridColumns.Add(col); gridAllergyReconcile.ListGridRows.Clear(); GridRow row; AllergyDef ald = new AllergyDef(); for (int i = 0; i < _listAllergyReconcile.Count; i++) { row = new GridRow(); ald = new AllergyDef(); if (_listAllergyReconcile[i].IsNew) { //To find the allergy def for new allergies, get the index of the matching allergy in ListAllergyNew, and use that index in ListAllergyDefNew because they are 1 to 1 lists. ald = ListAllergyDefNew[ListAllergyNew.IndexOf(_listAllergyReconcile[i])]; } for (int j = 0; j < _listAllergyDefCur.Count; j++) { if (_listAllergyReconcile[i].AllergyDefNum > 0 && _listAllergyReconcile[i].AllergyDefNum == _listAllergyDefCur[j].AllergyDefNum) { ald = _listAllergyDefCur[j]; //Gets the allergydef matching the allergy so we can use it to populate the grid break; } } row.Cells.Add(DateTime.Now.ToShortDateString()); if (ald.Description == null) { row.Cells.Add(""); } else { row.Cells.Add(ald.Description); } if (_listAllergyReconcile[i].Reaction == null) { row.Cells.Add(""); } else { row.Cells.Add(_listAllergyReconcile[i].Reaction); } if (_listAllergyReconcile[i].StatusIsActive) { row.Cells.Add(""); } else { row.Cells.Add("X"); } row.Cells.Add(_listAllergyReconcile[i].IsNew?"X":""); gridAllergyReconcile.ListGridRows.Add(row); } gridAllergyReconcile.EndUpdate(); }
public static GridRow getonerow(UserShip us) { object[] vals = new object[19]; vals[0] = us.fleetId > 0 ? (GameData.instance.UserFleets[us.fleetId - 1].title) : ""; vals[1] = us.level; vals[2] = us.ship.title; vals[3] = tools.helper.getshiptype(us.ship.type); vals[4] = tools.helper.getShipSmallImage(us); vals[5] = 100 * us.battleProps.hp / us.battlePropsMax.hp; vals[6] = us.battleProps.def;// +"/" + us.battlePropsMax.def; vals[7] = us.battleProps.atk;// + "/" + us.battlePropsMax.atk; vals[8] = us.battleProps.torpedo;// + "/" + us.battlePropsMax.torpedo; vals[9] = us.battleProps.airDef;// + "/" + us.battlePropsMax.airDef; vals[10] = us.battleProps.antisub;// + "/" + us.battlePropsMax.antisub; vals[11] = us.battleProps.radar;// + "/" + us.battlePropsMax.radar; vals[12] = us.battleProps.speed;// + "/" + us.battlePropsMax.def; vals[13] = us.battleProps.luck;// + "/" + us.battlePropsMax.def; vals[14] = +us.battleProps.miss;// + "/" + us.battlePropsMax.miss; vals[15] = us.love + "/" + us.loveMax; vals[16] = "选择"; vals[17] = us.IsLocked ? "解锁" : "锁定"; vals[18] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; return gr; }
private void updateLevelInfo() { GridPanel panel = levellist.PrimaryGrid; panel.Rows.Clear(); int i = 0; foreach (PVELevel level in PVEConfigs.instance.Levels) { object[] vals = new object[9]; PVEChapter pc = PVEConfigs.instance.GetChapter(level.pveId); vals[0] = level.id; vals[1] = level.title; vals[2] = pc.title; vals[3] = level.subTitle; vals[4] = "res/png/map_route/" + level.mapId + ".png"; vals[5] = false; vals[6] = "出战"; vals[7] = level.id; GridRow gr = new GridRow(vals); gr.RowHeight = 150; panel.Rows.Add(gr); i++; } foreach (PVEEventLevel level in PVEConfigs.instance.EventLevels) { object[] vals = new object[9]; vals[0] = level.id; vals[1] = level.title; vals[2] = tools.helper.getPVEEVENTAwardString(level); vals[3] = level.subTitle; vals[4] = "res/png/map_route/" + level.mapId + ".png"; vals[5] = false; vals[6] = "出战"; vals[7] = level.id; GridRow gr = new GridRow(vals); gr.RowHeight = 150; panel.Rows.Add(gr); i++; } }
/// <summary> /// To analyze. /// </summary> protected override void OnAnalyze() { var chart = Chart; var grid = Grid; var chartSeries = new XyDataSeries<double, double>(); ThreadSafeObservableCollection<GridRow> gridSeries = null; chart.GuiSync(() => { // clear prev values chart.RenderableSeries.Clear(); grid.Columns.Clear(); chart.RenderableSeries.Add(new FastColumnRenderableSeries { ResamplingMode = ResamplingMode.None, DataPointWidth = 1, SeriesColor = Colors.Chocolate, DataSeries = chartSeries }); chart.XAxis = new NumericAxis { AxisTitle = LocalizedStrings.Price }; chart.YAxis = new NumericAxis { AxisTitle = LocalizedStrings.Volume, GrowBy = new DoubleRange(0, 0.1) }; grid.AddTextColumn("Price", LocalizedStrings.Price).Width = 150; var volumeColumn = grid.AddTextColumn("Volume", LocalizedStrings.Volume); volumeColumn.Width = 100; var gridSource = new ObservableCollectionEx<GridRow>(); grid.ItemsSource = gridSource; gridSeries = new ThreadSafeObservableCollection<GridRow>(gridSource); grid.SetSort(volumeColumn, ListSortDirection.Descending); }); // get candle storage var storage = StorateRegistry.GetCandleStorage(typeof(TimeFrameCandle), Security, TimeFrame, format: StorageFormat); // get available dates for the specified period var dates = storage.GetDates(From, To).ToArray(); var rows = new Dictionary<decimal, GridRow>(); foreach (var loadDate in dates) { // check if stopped if (ProcessState != ProcessStates.Started) break; // load candles var candles = storage.Load(loadDate); // groupping candles by candle's middle price var groupedCandles = candles.GroupBy(c => c.LowPrice + c.GetLength() / 2); foreach (var group in groupedCandles.OrderBy(g => g.Key)) { // check if stopped if (ProcessState != ProcessStates.Started) break; var price = group.Key; // calc total volume for the specified time frame var sumVol = group.Sum(c => c.TotalVolume); var row = rows.TryGetValue(price); if (row == null) { // new price level rows.Add(price, row = new GridRow { Price = price, Volume = sumVol }); // draw on chart chartSeries.Append((double)price, (double)sumVol); // draw on table gridSeries.Add(row); } else { // update existing price level row.Volume += sumVol; // update chart chartSeries.Update((double)price, (double)row.Volume); } } chart.GuiAsync(() => { // update grid sorting grid.RefreshSort(); // scale chart chart.ZoomExtents(); }); } // notify the script stopped Stop(); }
public GridListCell(GridRow row, GridListColumn column) : base(row, column) { Column = column; ListValue = column.DefaultCellValue; }
///<summary>Fills the passed in grid with the definitions in the passed in list.</summary> public static void FillGridDefs(ODGrid gridDefs, DefCatOptions selectedDefCatOpt, List <Def> listDefsCur) { Def selectedDef = null; if (gridDefs.GetSelectedIndex() > -1) { selectedDef = (Def)gridDefs.ListGridRows[gridDefs.GetSelectedIndex()].Tag; } int scroll = gridDefs.ScrollValue; gridDefs.BeginUpdate(); gridDefs.ListGridColumns.Clear(); GridColumn col; col = new GridColumn(Lan.g("TableDefs", "Name"), 190); gridDefs.ListGridColumns.Add(col); col = new GridColumn(selectedDefCatOpt.ValueText, 190); gridDefs.ListGridColumns.Add(col); col = new GridColumn(selectedDefCatOpt.EnableColor ? Lan.g("TableDefs", "Color") : "", 40); gridDefs.ListGridColumns.Add(col); col = new GridColumn(selectedDefCatOpt.CanHide ? Lan.g("TableDefs", "Hide") : "", 30, HorizontalAlignment.Center); gridDefs.ListGridColumns.Add(col); gridDefs.ListGridRows.Clear(); GridRow row; foreach (Def defCur in listDefsCur) { if (!PrefC.IsODHQ && defCur.ItemValue == CommItemTypeAuto.ODHQ.ToString()) { continue; } if (Defs.IsDefDeprecated(defCur)) { defCur.IsHidden = true; } row = new GridRow(); if (selectedDefCatOpt.CanEditName) { row.Cells.Add(defCur.ItemName); } else //Users cannot edit the item name so let them translate them. { row.Cells.Add(Lan.g("FormDefinitions", defCur.ItemName)); //Doesn't use 'this' so that renaming the form doesn't change the translation } if (selectedDefCatOpt.DefCat == DefCat.ImageCats) { row.Cells.Add(GetItemDescForImages(defCur.ItemValue)); } else if (selectedDefCatOpt.DefCat == DefCat.AutoNoteCats) { Dictionary <string, string> dictAutoNoteDefs = new Dictionary <string, string>(); dictAutoNoteDefs = listDefsCur.ToDictionary(x => x.DefNum.ToString(), x => x.ItemName); string nameCur; row.Cells.Add(dictAutoNoteDefs.TryGetValue(defCur.ItemValue, out nameCur) ? nameCur : defCur.ItemValue); } else if (selectedDefCatOpt.DefCat == DefCat.WebSchedNewPatApptTypes) { AppointmentType appointmentType = AppointmentTypes.GetWebSchedNewPatApptTypeByDef(defCur.DefNum); row.Cells.Add(appointmentType == null ? "" : appointmentType.AppointmentTypeName); } else if (selectedDefCatOpt.DoShowItemOrderInValue) { row.Cells.Add(defCur.ItemOrder.ToString()); } else { row.Cells.Add(defCur.ItemValue); } row.Cells.Add(""); if (selectedDefCatOpt.EnableColor) { row.Cells[row.Cells.Count - 1].ColorBackG = defCur.ItemColor; } if (defCur.IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Tag = defCur; gridDefs.ListGridRows.Add(row); } gridDefs.EndUpdate(); if (selectedDef != null) { for (int i = 0; i < gridDefs.ListGridRows.Count; i++) { if (((Def)gridDefs.ListGridRows[i].Tag).DefNum == selectedDef.DefNum) { gridDefs.SetSelected(i, true); break; } } } gridDefs.ScrollValue = scroll; }
private void FillGrid() { RxDef[] arrayRxDefs = _arrayRxDefs; if (textDrug.Text != "") { string[] arraySearchTerms = textDrug.Text.Split(' '); foreach (string searchTerm in arraySearchTerms) { arrayRxDefs = arrayRxDefs.Where(x => x.Drug.ToLower().Contains(searchTerm.ToLower())).ToArray(); } } if (textDisp.Text != "") { string[] arraySearchTerms = textDisp.Text.Split(' '); foreach (string searchTerm in arraySearchTerms) { arrayRxDefs = arrayRxDefs.Where(x => x.Disp.ToLower().Contains(searchTerm.ToLower())).ToArray(); } } if (checkControlledOnly.Checked) { arrayRxDefs = arrayRxDefs.Where(x => x.IsControlled).ToArray(); } gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("TableRxSetup", "Drug"), 140); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableRxSetup", "Controlled"), 70, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableRxSetup", "Sig"), 250); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableRxSetup", "Disp"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableRxSetup", "Refills"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableRxSetup", "Notes"), 300); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < arrayRxDefs.Length; i++) { row = new GridRow(); row.Cells.Add(arrayRxDefs[i].Drug); if (arrayRxDefs[i].IsControlled) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(arrayRxDefs[i].Sig); row.Cells.Add(arrayRxDefs[i].Disp); row.Cells.Add(arrayRxDefs[i].Refills); row.Cells.Add(arrayRxDefs[i].Notes); gridMain.ListGridRows.Add(row); row.Tag = arrayRxDefs[i]; } gridMain.EndUpdate(); }
private void updateBackupShipInfo() { GridPanel panel = backupshiplist.PrimaryGrid; panel.Rows.Clear(); int i = 0; foreach (UserShip us in GameData.instance.UserShips.OrderByDescending(o => o.level).ToList()) { if (us.IsInExplore || us.fleetId > 0) { continue; } object[] vals = new object[17]; vals[0] = false; vals[1] = us.level; vals[2] = tools.helper.getshiptype(us.ship.type); vals[3] = us.ship.title; vals[4] = tools.helper.getShipSmallImage(us);//"res/png/head_n/" + us.ship.picId + ".png"; vals[5] = us.battleProps.hp + "/" + us.battlePropsMax.hp; vals[6] = us.battleProps.def; vals[7] = us.battleProps.atk; vals[8] = us.battleProps.torpedo; vals[9] = us.battleProps.airDef; vals[10] = us.battleProps.antisub; vals[11] = us.battleProps.radar; vals[12] = us.battleProps.speed; vals[13] = us.battleProps.luck; vals[14] = +us.battleProps.miss; vals[15] = us.love; vals[16] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; panel.Rows.Add(gr); i++; } }
public GridPopupEditFormHtmlBuilder(GridRow <T> row) : base(row) { }
public ExpandableObjectEditor(GridRow parentRow) : base(parentRow) { }