private void Window_Loaded(object sender, RoutedEventArgs e) { calculator = new CalcQuick(); this.calculator["base"] = (3).ToString(); this.calculator["height"] = (2.5).ToString(); }
private void AngleForm_Load(object sender, System.EventArgs e) { //TextBox Angle = new TextBox(); this.Angle.Name = "Angle"; this.Angle.Text = "30"; //cosTB = new TextBox(); this.cosTB.Name = "cosTB"; this.cosTB.Text = "= cos([Angle] * pi() / 180) "; //sinTB = new TextBox(); this.sinTB.Name = "sinTB"; this.sinTB.Text = "= sin([Angle] * pi() / 180) "; //Instantiate a CalcQuick object: calculator = new CalcQuick(); //Register the controls used in calculations. //The formula names used are the Control.Name strings. this.calculator.RegisterControlArray(new Control[] { this.Angle, this.cosTB, this.sinTB }); //Allow the CalcQuick sheet to create dependency lists among the formula objects //necesary for auto-calculations. this.calculator.RefreshAllCalculations(); }
private void AlgebraicExpressions_Load(object sender, System.EventArgs e) { //Initialize CalcQuick object calculator = new CalcQuick(); this.calculator["base"] = (3).ToString(); this.calculator["height"] = (2.5).ToString(); }
private void Form1_Load(object sender, System.EventArgs e) { calculator = new CalcQuick(); this.textBox1.Text = "12"; this.textBox2.Text = "=[A] + [C]"; this.textBox3.Text = "13"; }
private void Window_Loaded(object sender, RoutedEventArgs e) { calculator = new CalcQuick(); this.txtA.Text = "12"; this.txtB.Text = "=[A] + [C]"; this.txtC.Text = "13"; }
private void AngleForm_Load(object sender, System.EventArgs e) { //TextBox Angle = new TextBox(); this.Angle.Name = "Angle"; this.Angle.Text = "30"; //cosTB = new TextBox(); this.cosTB.Name = "cosTB"; this.cosTB.Text = "= cos([Angle] * pi() / 180) "; //sinTB = new TextBox(); this.sinTB.Name = "sinTB"; this.sinTB.Text = "= sin([Angle] * pi() / 180) "; //Instantiate the CalcQuick object: this.calculator = new CalcQuick(); }
public ViewModel() { CalcQuick calculate = new CalcQuick(); foreach (string formula in calculate.Engine.LibraryFunctions.Keys) { ListOfFormula.Add(new BindList() { Formula = formula }); } tempListOfFormula = new ObservableCollection <BindList>(ListOfFormula.OrderBy(c => c.Formula)); tempListOfFormula.RemoveAt(0); tempListOfFormula.RemoveAt(0); tempListOfFormula.RemoveAt(0); ListOfFormula = tempListOfFormula; }
private void Window_Loaded(object sender, RoutedEventArgs e) { //TextBox Angle = new TextBox(); this.Angle.Name = "Angle"; this.Angle.Text = "30"; //cosTB = new TextBox(); this.cosTB.Name = "cosTB"; this.cosTB.Text = "= cos([Angle] * pi() / 180) "; //sinTB = new TextBox(); this.sinTB.Name = "sinTB"; this.sinTB.Text = "= sin([Angle] * pi() / 180) "; //Instantiate a CalcQuick object: calculator = new CalcQuick(); this.calculator["Angle"] = this.Angle.Text; this.calculator["cosTB"] = this.cosTB.Text; this.calculator["sinTB"] = this.sinTB.Text; //Mark the calculator dirty: this.calculator.SetDirty(); //Now as the values are retrieved from the calculator, they //will be the newly calculated values. this.cosTB.Text = this.calculator["cosTB"]; this.sinTB.Text = this.calculator["sinTB"]; //Register the controls used in calculations. //The formula names used are the Control.Name strings. this.calculator.RegisterControlArray(new System.Windows.Controls.Control[] { this.Angle, this.cosTB, this.sinTB }); //Allow the CalcQuick sheet to create dependency lists among the formula objects //necesary for auto-calculations. this.calculator.RefreshAllCalculations(); }
private void MoreComplexForm_Load(object sender, System.EventArgs e) { //Instantiate a CalcQuick object: calculator = new CalcQuick(); //Register the controls used in calculations. //The formula names used are the Control.Name strings. this.calculator.RegisterControlArray(new Control[] { this.Quantity, this.Price, this.Discount, this.Shipping, this.Tax, this.Total }); //Allow the CalcQuick sheet to create dependency lists among the formula objects //necesary for auto-calculations and do the initial computations. this.calculator.RefreshAllCalculations(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { //1) Instantiate a CalcQuick object: calculator = new CalcQuick(); //2) Populate your controls: this.txtA.Text = "12"; this.txtB.Text = "3"; this.txtC.Text = "= [A] + 2 * [B]"; //C is the only formula: this.lblc.Content = this.txtC.Text; //Must enter formula names before turning on calculations. //3) Assign formula object names: calculator["A"] = this.txtA.Text; calculator["B"] = this.txtB.Text; calculator["C"] = this.txtC.Text; calculator["D"] = this.txtD.Text; //4) Turn on auto calculations: this.calculator.AutoCalc = true; //5) Subscribe to the event to set newly calculated values: this.calculator.ValueSet += new QuickValueSetEventHandler(calculator_ValueSet); //6) Subscribe to some events (in this case, Leave events) to trigger setting values into CalcQuick: this.txtA.LostFocus += new RoutedEventHandler(txtA_MouseLeave); this.txtB.LostFocus += new RoutedEventHandler(txtB_MouseLeave); this.txtC.LostFocus += new RoutedEventHandler(txtC_MouseLeave); this.txtD.LostFocus += new RoutedEventHandler(txtD_MouseLeave); //7) Allow the CalcQuick sheet to create dependency lists among the formula objects // necesary for auto-calculations. this.calculator.RefreshAllCalculations(); }
/// <summary> /// 최종외부점수계산 / 최종점수 Rollup /// </summary> public void CalcFinalExternalScore() { MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Score_Detail objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Score_Detail(); int iRtn = objBSC.UpdateExternalOriScore(this.IEstTermRefID, this.IYMD); CalcQuick objCAL = new CalcQuick(); DataSet rDs = objBSC.GetExternalScorePerKPI(this.IEstTermRefID, this.IYMD); int intRow = rDs.Tables[0].Rows.Count; int intCol = rDs.Tables[0].Columns.Count; int intRtn = 0; string strQrtMark = "\""; string sQM = "\""; int intEsttermRefID = 0; int intKpiRefID = 0; string strYMD = ""; string strUseTS = ""; string strOriTS = ""; string strAvgTS = ""; string strStdTS = ""; string strAdaTS = ""; string strAdsTS = ""; string strNorTS = ""; string strFnlTS = ""; string strColEsttermRefID = ""; string strColKpiRefID = ""; string strColYMD = ""; string strColUseTS = ""; string strColOriTS = ""; string strColAvgTS = ""; string strColStdTS = ""; string strColAdaTS = ""; string strColAdsTS = ""; string strColNorTS = ""; string strColFnlTS = ""; int itxr_user = gUserInfo.Emp_Ref_ID; DataRow dr; for (int i = 0; i < intRow; i++) { if (i == 0) { strColEsttermRefID = rDs.Tables[0].Columns[0].ColumnName; strColKpiRefID = rDs.Tables[0].Columns[1].ColumnName; strColYMD = rDs.Tables[0].Columns[2].ColumnName; strColUseTS = rDs.Tables[0].Columns[3].ColumnName; strColOriTS = rDs.Tables[0].Columns[4].ColumnName; strColAvgTS = rDs.Tables[0].Columns[5].ColumnName; strColStdTS = rDs.Tables[0].Columns[6].ColumnName; strColAdaTS = rDs.Tables[0].Columns[7].ColumnName; strColAdsTS = rDs.Tables[0].Columns[8].ColumnName; strColNorTS = rDs.Tables[0].Columns[9].ColumnName; strColFnlTS = rDs.Tables[0].Columns[10].ColumnName; } dr = rDs.Tables[0].Rows[i]; intEsttermRefID = Convert.ToInt32(dr["ESTTERM_REF_ID"].ToString()); intKpiRefID = Convert.ToInt32(dr["KPI_REF_ID"].ToString()); strYMD = Convert.ToString(dr["YMD"].ToString()); strUseTS = Convert.ToString(dr["NRMDST_USE_TS"].ToString()); strOriTS = Convert.ToString(dr["POINTS_ORI_TS"].ToString()); strAvgTS = Convert.ToString(dr["POINTS_AVG_TS"].ToString()); strStdTS = Convert.ToString(dr["POINTS_STD_TS"].ToString()); strAdaTS = Convert.ToString(dr["POINTS_ADA_TS"].ToString()); strAdsTS = Convert.ToString(dr["POINTS_ADS_TS"].ToString()); strNorTS = Convert.ToString(dr["POINTS_NOR_TS"].ToString()); strFnlTS = Convert.ToString(dr["POINTS_FNL_TS"].ToString()); objCAL[strColEsttermRefID] = intEsttermRefID.ToString(); objCAL[strColKpiRefID] = intKpiRefID.ToString(); objCAL[strColYMD] = strYMD; objCAL[strColUseTS] = strUseTS; objCAL[strColOriTS] = strOriTS; objCAL[strColAvgTS] = strAvgTS; objCAL[strColStdTS] = strStdTS; objCAL[strColAdaTS] = strAdaTS; objCAL[strColAdsTS] = strAdsTS; objCAL[strColNorTS] = strNorTS; objCAL[strColFnlTS] = strFnlTS; //objCAL[strColNorMS] = "=IF(["+strColStdMS+"]=0,0,ROUNDDOWN(NORMDIST(["+strColOriMS+"],["+strColAvgMS+"],["+strColStdMS+"],TRUE),8))"; objCAL[strColNorTS] = "=ROUNDDOWN(NORMDIST([" + strColOriTS + "],[" + strColAvgTS + "],[" + strColStdTS + "],TRUE),8)"; //objCAL[strColNorMS] = "=IF([" + strColUseMS + "]=" + sQM + "Y" + sQM + ",IF([" + strColStdMS + "]=0,0,ROUNDDOWN(NORMDIST(IF([" + strColAplBS + "]=" + sQM + "Y" + sQM + ",[" + strColAdsMS + "],[" + strColOriMS + "]),[" + strColAvgMS + "],[" + strColStdMS + "],TRUE),8)),IF([" + strColAplBS + "]=" + sQM + "Y" + sQM + ",[" + strColAdsMS + "],[" + strColOriMS + "]))"; //objCAL[strColNorTS] = "=IF([" + strColUseTS + "]=" + sQM + "Y" + sQM + ",IF([" + strColStdTS + "]=0,0,ROUNDDOWN(NORMDIST(IF([" + strColAplBS + "]=" + sQM + "Y" + sQM + ",[" + strColAdsTS + "],[" + strColOriTS + "]),[" + strColAvgTS + "],[" + strColStdTS + "],TRUE),8)),IF([" + strColAplBS + "]=" + sQM + "Y" + sQM + ",[" + strColAdsTS + "],[" + strColOriTS + "]))"; //objCAL[strColFnlMS] = "=IF(IF(["+strColUseMS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriMS+"],(85+(["+strColNorMS+"]-0.5)*30))<70,0, IF(["+strColUseMS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriMS+"],(85+(["+strColNorMS+"]-0.5)*30)))"; //objCAL[strColFnlTS] = "=IF(IF(["+strColUseTS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriTS+"],(85+(["+strColNorTS+"]-0.5)*30))<70,0, IF(["+strColUseTS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriTS+"],(85+(["+strColNorTS+"]-0.5)*30)))"; //objCAL[strColFnlMS] = "=IF(["+strColStdMS+"]=0, 85, IF(["+strColUseMS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriMS+"],(85+(["+strColNorMS+"]-0.5)*30)))"; //objCAL[strColFnlTS] = "=IF(["+strColStdTS+"]=0, 85, IF(["+strColUseTS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriTS+"],(85+(["+strColNorTS+"]-0.5)*30)))"; //objCAL[strColFnlMS] = "=IF(["+strColUseMS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriMS+"], IF(["+strColStdMS+"]=0, 85, (85+(["+strColNorMS+"]-0.5)*30)))"; //objCAL[strColFnlTS] = "=IF(["+strColUseTS+"]="+strQrtMark+"N"+strQrtMark+",["+strColOriTS+"], IF(["+strColStdTS+"]=0, 85, (85+(["+strColNorTS+"]-0.5)*30)))"; // 누적확률을 돌리지 않으면 원시점수 , 누적확률이 0 이면 기본점수 80 그렇지 않으면 (85+([누적확률]-0.5)*30) objCAL[strColFnlTS] = "=IF([" + strColUseTS + "]=" + sQM + "N" + sQM + ",[" + strColOriTS + "], IF([" + strColStdTS + "]=0, 85, (85+([" + strColNorTS + "]-0.5)*30)))"; objCAL.SetDirty(); strNorTS = objCAL[strColNorTS].ToString(); strFnlTS = objCAL[strColFnlTS].ToString(); strNorTS = PageUtility.IsAllNumber(strNorTS) ? strNorTS : "0"; strFnlTS = PageUtility.IsAllNumber(strFnlTS) ? strFnlTS : "0"; intRtn = objBSC.UpdateExternalScore (intEsttermRefID , intKpiRefID , strYMD , strUseTS , strOriTS , strAvgTS , strStdTS , strAdaTS , strAdsTS , strNorTS , strFnlTS , itxr_user ); } // 최종점수 롤업 MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail objTrm = new MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail(); intRtn = objTrm.SetNormdisScoreRollUp(this.IEstTermRefID, this.IYMD); }