//Calculate: private void button1_Click(object sender, System.EventArgs e) { calculator["A"] = this.textBox1.Text; calculator["B"] = this.textBox2.Text; calculator["C"] = this.textBox3.Text; calculator["D"] = this.textBox4.Text; calculator.SetDirty(); this.textBox1.Text = calculator["A"].ToString(); this.textBox2.Text = calculator["B"].ToString(); this.textBox3.Text = calculator["C"].ToString(); this.textBox4.Text = calculator["D"].ToString(); }
private void butCalc_Click(object sender, RoutedEventArgs e) { calculator["A"] = this.txtA.Text; calculator["B"] = this.txtB.Text; calculator["C"] = this.txtC.Text; calculator["D"] = this.txtD.Text; calculator.SetDirty(); this.txtA.Text = calculator["A"].ToString(); this.txtB.Text = calculator["B"].ToString(); this.txtC.Text = calculator["C"].ToString(); this.txtD.Text = calculator["D"].ToString(); }
public void Execute(object parameter) { calculate["A"] = viewModel.TxtA; calculate["B"] = viewModel.TxtB; calculate["C"] = viewModel.TxtC; calculate["D"] = viewModel.TxtD; calculate["Gen"] = viewModel.TxtGen; calculate.SetDirty(); viewModel.TxtA = calculate["A"]; viewModel.TxtB = calculate["B"]; viewModel.TxtC = calculate["C"]; viewModel.TxtD = calculate["D"]; viewModel.TxtGen = calculate["Gen"]; }
/// <summary> /// Instantiate a CalcQuick object /// </summary> private void Window_Loaded(object sender, RoutedEventArgs e) { this.txtPrice.Text = "0"; //Instantiate a CalcQuick object: calculator["Quantity"] = this.txtQty.Text; calculator["Price"] = this.txtPrice.Text; calculator["Discount"] = this.cboDiscount.Text; calculator["Shipping"] = this.txtShipping.Text; calculator["Tax"] = this.txtTax.Text; calculator["Total"] = this.txtTotal.Text; calculator.SetDirty(); this.txtQty.Text = calculator["Quantity"]; this.txtPrice.Text = calculator["Price"]; this.cboDiscount.Text = calculator["Discount"]; this.txtShipping.Text = calculator["Shipping"]; this.txtTax.Text = calculator["Tax"]; this.txtTotal.Text = calculator["Total"]; }
/// <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); }