public void RefreshLayout() { try { string filepath = ""; Econ ec = new Econ(); IList <Substation_Info> list = Services.BaseService.GetList <Substation_Info>("SelectSubstation_InfoByFlag", flags1); if (xmlflag == "guihua") { ec.UID = xmltype; } else { ec.UID = xmltype + "SubstationLayOut"; } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); if (listxml.Count != 0) { MemoryStream ms = new MemoryStream(listxml[0].ExcelData); this.bandedGridView1.RestoreLayoutFromStream(ms); } } catch { } }
public void Compiled2g() { Facts.Clear(); Thing p = new Thing("p"); Thing c = new Thing("c"); Thing c2 = new Thing("c2"); Facts.Assert(p, "Econ.EmploymentRelationship", c2, "Employee"); Tbool result = Econ.IsEmployedBy(p, c2); Assert.AreEqual(true, result.Out); }
/// <summary> /// 刷新表格中的数据 /// </summary> /// <returns>ture:成功 false:失败</returns> public bool RefreshData1() { try { string filepath = ""; Econ ec = new Econ(); IList <Substation_Info> list = Services.BaseService.GetList <Substation_Info>("SelectSubstation_InfoByFlag", flags1); if (xmlflag == "guihua") { ec.UID = xmltype; } else { ec.UID = xmltype + "SubstationLayOut"; } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); if (listxml.Count != 0) { MemoryStream ms = new MemoryStream(listxml[0].ExcelData); this.bandedGridView1.RestoreLayoutFromStream(ms); } int i = 1; foreach (Substation_Info info in list) { info.L23 = i.ToString(); i++; double?l2 = info.L2; double?l9 = info.L9; double?l10 = info.L10; try { if (l2 != 0) { l10 = l9 / l2; info.L10 = l10; } } catch { } } this.gridControl.DataSource = list; } catch (Exception exc) { Debug.Fail(exc.Message); HandleException.TryCatch(exc); return(false); } return(true); }
private void button1_Click(object sender, EventArgs e) { Econ ec = new Econ(); ec.UID = "yyy"; System.IO.MemoryStream ms = new System.IO.MemoryStream(); try { // fpSpread1.Save(ms, false); ec.ExcelData = ms.GetBuffer(); Services.BaseService.Create <Econ>(ec); //Services.BaseService.Update<Econ>(ec); } catch (Exception ex) { MsgBox.Show(ex.Message); } }
private void InitData() { //if (!isSelect) //{ // switch (smmprog.ProgId) // { // case "64c9efcb-e6cc-402f-b2fc-f5f6f7d296f7": // progName = "负荷特性分析"; // type = "fhtxfx"; // break; // case "a50e1781-e470-4721-a6ee-c4b1294d6bd4": // progName = "电网基础数据"; // type = "dwjcsj"; // break; // case "3630adcc-9d4b-4059-b44e-4f88ccf76b43": // progName = "电网规划基础表"; // type = "dwghjc"; // break; // } //} PspType pt = new PspType(); pt.Col1 = ProjectUID; ilist = Services.BaseService.GetList("SelectPspTypeList", pt); //ilist = Services.BaseService.GetList<PspType>(); dataTable = DataConverter.ToDataTable(ilist, typeof(PspType)); treeList1.DataSource = dataTable; Econ ed = new Econ(); ed.UID = "Excel"; try { bts = Services.BaseService.GetOneByKey <Econ>(ed).ExcelData; } catch { } }
public void TestGet30yearBalance() { var testSubject = new FixedRateLoan(DateTime.Today, 0.0885F, new Pecuniam(150000)) { Rate = 0.05F }; var testResult = testSubject.GetValueAt(DateTime.Today.AddYears(30)); Console.WriteLine(testResult); var fv = Econ.PerDiemInterest(150000M, 0.03F, (DateTime.Today.AddYears(30) - DateTime.Today).TotalDays); Console.WriteLine(fv); var v = fv / 30; v = v / 12; Console.WriteLine(v); }
private void InitData() { if (!isSelect) { switch (smmprog.ProgId) { case "64c9efcb-e6cc-402f-b2fc-f5f6f7d296f7": progName = "负荷特性分析"; type = "fhtxfx"; break; case "a50e1781-e470-4721-a6ee-c4b1294d6bd4": progName = "电网基础数据"; type = "dwjcsj"; break; case "3630adcc-9d4b-4059-b44e-4f88ccf76b43": progName = "电网规划基础表"; type = "dwghjc"; break; } } string s = " UID like '%|" + ProjectUID + "' and Col1='" + progName + "'"; ilist = Services.BaseService.GetList("SelectPspTypeListByWhere", s); //ilist = Services.BaseService.GetList<PspType>(); dataTable = DataConverter.ToDataTable(ilist, typeof(PspType)); treeList1.DataSource = dataTable; Econ ed = new Econ(); ed.UID = "yyy"; try { bts = Services.BaseService.GetOneByKey <Econ>(ed).ExcelData; } catch { } }
public void RefreshLayout() { try { string filepath1 = ""; Econ ec = new Econ(); if (types2 == "66") { //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType+"RefreshDatalayout1.xml"); if (FlagsType == "") { ec.UID = "RefreshDatalayout1"; } else { ec.UID = FlagsType + "RefreshDatalayout1"; } } if (types2 == "10") { //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType + "RefreshDatalayout2.xml"); if (FlagsType == "") { ec.UID = "RefreshDatalayout2"; } else { ec.UID = FlagsType + "RefreshDatalayout2"; } } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); if (listxml.Count != 0) { MemoryStream ms = new MemoryStream(listxml[0].ExcelData); this.bandedGridView2.RestoreLayoutFromStream(ms); } } catch { } }
public void RefreshLayout() { try { Econ ec = new Econ(); if (xmlflag == "guihua") { ec.UID = xmltype; } else { ec.UID = xmltype + "SubstationLayOut"; } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); if (listxml.Count != 0) { MemoryStream ms = new MemoryStream(listxml[0].ExcelData); this.gridView.RestoreLayoutFromStream(ms); } } catch { } }
public bool RefreshData(string type, string con) { IList <Line_Info> list = new List <Line_Info>(); string conn = ""; try { types1 = type; int dd = 0; if (types2 == "220") { dd = 220; } else if (types2 == "66") { dd = 66; } else if (types2 == "10") { dd = 10; } Line_Info li = new Line_Info(); li.DY = dd; li.Flag = type; string filepath1 = ""; Econ ec = new Econ(); if (types2 == "220") { conn = "Code='' and Flag='" + type + "'" + con; list = Services.BaseService.GetList <Line_Info>("SelectLine_InfoByConn", conn); CalcTotal(ref list); //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType+"RefreshDatalayout1.xml"); if (FlagsType == "") { ec.UID = "RefreshDatalayout2"; } else { ec.UID = FlagsType + "RefreshDatalayout2"; } } if (types2 == "66") { conn = "DY>10 and 10000>=DY and AreaID='" + projectid + "' " + con;// ; list = Services.BaseService.GetList <Line_Info>("SelectLine_InfoByConn", conn); CalcTotal(ref list); //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType+"RefreshDatalayout1.xml"); if (FlagsType == "") { ec.UID = "RefreshDatalayout1"; } else { ec.UID = FlagsType + "RefreshDatalayout1"; } } if (types2 == "10") { conn = " DY>0 and 10>=DY " + con; list = Services.BaseService.GetList <Line_Info>("SelectLine_InfoByConn", conn); CalcTotal(ref list); //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType+"RefreshDatalayout1.xml"); //filepath1 = Path.GetTempPath()+ Path.GetFileName(FlagsType + "RefreshDatalayout2.xml"); if (FlagsType == "") { ec.UID = "RefreshDatalayout2"; } else { ec.UID = FlagsType + "RefreshDatalayout2"; } } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); //if (listxml.Count != 0) //{ // MemoryStream ms = new MemoryStream(listxml[0].ExcelData); // this.bandedGridView2.RestoreLayoutFromStream(ms); //} //if (types2 == "66") //{ list = Services.BaseService.GetList<Line_Info>("SelectLine_InfoByFlagDy", li); } //else if (types2 == "10") //{ list = Services.BaseService.GetList<Line_Info>("SelectLine_InfoByFlagDy1", li); } string s = " ProjectID='" + Itop.Client.MIS.ProgUID + "'"; IList list1 = Services.BaseService.GetList("SelectPS_Table_AreaWHByConn", s); repositoryItemLookUpEdit1.DisplayMember = "Title"; repositoryItemLookUpEdit1.NullText = ""; repositoryItemLookUpEdit1.ValueMember = "ID"; repositoryItemLookUpEdit1.DataSource = list1; //IList<Line_Info> list = Services.BaseService.GetList<Line_Info>("SelectLine_InfoByFlagDy", li); this.gridControl.DataSource = list; } catch (Exception exc) { Debug.Fail(exc.Message); HandleException.TryCatch(exc); return(false); } return(true); }
private static Tbool SomeoneWorksAt(Thing c, Tset theSet) { return(theSet.Exists(_ => Econ.IsEmployedBy(_, c))); }
/// <summary> /// 刷新表格中的数据 /// </summary> /// <returns>ture:成功 false:失败</returns> public bool RefreshData1() { try { string filepath = ""; Econ ec = new Econ(); if (xmlflag == "guihua") { ec.UID = xmltype; } else { ec.UID = xmltype + "SubstationLayOut"; } if (xmlflag == "guihuaExpressCal") { ec.UID = xmltype; } IList <Econ> listxml = Services.BaseService.GetList <Econ>("SelectEconByKey", ec); if (listxml.Count != 0) { MemoryStream ms = new MemoryStream(listxml[0].ExcelData); this.gridView.RestoreLayoutFromStream(ms); } IList <Substation_Info> list = Services.BaseService.GetList <Substation_Info>("SelectSubstation_InfoByFlag", flags); int i = 1; foreach (Substation_Info listtemp in list) { listtemp.AreaID = i.ToString(); i++; } // foreach (GridColumn gc in GridView.Columns) //{ // if (gc.FieldName.Substring(0, 1) == "S") // { // PSP_ExpressionCalculator express = new PSP_ExpressionCalculator(); // express.FiledName = gc.FieldName; // express.Flag = 0; // IList<PSP_ExpressionCalculator> listtemp = Services.BaseService.GetList<PSP_ExpressionCalculator>("SelectPSP_ExpressionCalculatorByFiledNameFlag",express); // if(listtemp!=null) // if(listtemp.Count>0) // { // ExpressionCalculator ca = new ExpressionCalculator(); // ca.RowCalculator(listtemp[0].Expression, this.gridView, ref list, gc.FieldName,listtemp[0].SaveDecimalPoint); // } // } // } this.gridControl.DataSource = list; } catch (Exception exc) { Debug.Fail(exc.Message); HandleException.TryCatch(exc); return(false); } return(true); }