private double Evaluated(FColumn fcx, int columnstt, DataTable dt) { System.Collections.Hashtable h = new System.Collections.Hashtable(); Formula.BieuThuc bt = new Formula.BieuThuc(fcx.FormulaColumn); foreach (string str in bt.variables) { bool kt = true; for (int j = 0; j < listFColumn.Count; j++) { FColumn fc = listFColumn[j]; if (dt.Rows[fc.Rowstt]["MaSo"].ToString().ToUpper() == str.ToUpper() && fc.IsEvaluated == false) { dt.Rows[fc.Rowstt][columnstt] = Evaluated(fc, columnstt, dt); kt = false; fc.IsEvaluated = true; h.Add(str, dt.Rows[fc.Rowstt][columnstt]); break; } } if (kt == true) { for (int i = 0; i < dt.Rows.Count; i++) { string MaSo = dt.Rows[i]["MaSo"].ToString(); if (str.ToUpper() == MaSo.ToUpper()) { h.Add(str, dt.Rows[i][columnstt]); break; } } } } return(bt.Evaluate(h)); }
private List <string> getLstBien(string Formular) { if (Formular.Contains("ROUND(")) { Formular = Formular.Substring(6, Formular.Length - 9); } BieuThuc a = new Formula.BieuThuc(Formular); return(a.variables); }
public YtPhanBo(DataRow dr, DataTable TPNhapkho, DateTime tungay, DateTime denngay) { dryt = dr; if (dryt["YTPT"].ToString() != null) { congthuc = dryt["YTPT"].ToString(); bt = new BieuThuc(congthuc); } drTPNhapkho = TPNhapkho; _Tungay = tungay; _Denngay = denngay; dtkq = TPNhapkho.Copy(); dtkq.Columns.Add(createCol()); Name = dr["MaYT"].ToString(); }
private List <string> getLstBien(string Formular) { BieuThuc a = new Formula.BieuThuc(Formular); return(a.variables); }