private static void pmGetCostLine(WS.Data.Agents.cDBMSAgent inSQLUtil, ref QCostLineInfo ioInfo, string inRefTab, string inMasterH, string inType, bool inIsFixUnit) { ioInfo.Cost_Fix = 0; ioInfo.Cost_Var_ManHour1 = 0; ioInfo.Cost_Var_ManHour2 = 0; ioInfo.Cost_Var_ManHour3 = 0; ioInfo.Cost_Var_ManHour4 = 0; ioInfo.Cost_Var_ManHour5 = 0; ioInfo.Cost_Var_ByOutput1 = 0; ioInfo.Cost_Var_ByOutput2 = 0; ioInfo.Cost_Var_ByOutput3 = 0; ioInfo.Cost_Var_ByOutput4 = 0; ioInfo.Cost_Var_ByOutput5 = 0; DataSet dtsDataEnv = new DataSet(); string strErrorMsg = ""; WS.Data.Agents.cDBMSAgent pobjSQLUtil = inSQLUtil; string strSQLStr_CostLine = "select COSTLINE.CCOSTTYPE, COSTLINE.NAMT, COSTLINE.CCOSTBY from COSTLINE where CREFTAB = ? and CMASTERH = ? and CTYPE = ? "; pobjSQLUtil.SetPara(new object[] { inRefTab, inMasterH, inType }); pobjSQLUtil.SQLExec(ref dtsDataEnv, "QCostLine", QCostLineInfo.TableName, strSQLStr_CostLine, ref strErrorMsg); foreach (DataRow dtrCostLine in dtsDataEnv.Tables["QCostLine"].Rows) { decimal decAmt = Convert.ToDecimal(dtrCostLine[QCostLineInfo.Field.Amt]); string strCostBy = dtrCostLine[QCostLineInfo.Field.CostBy].ToString(); switch (dtrCostLine[QCostLineInfo.Field.CostType].ToString()) { case "FIX": ioInfo.Cost_Fix = decAmt; break; case "VM1": ioInfo.Cost_Var_ManHour1 = (inIsFixUnit ? decAmt : pmConvert2Sec(decAmt, strCostBy)); ioInfo.Cost_Var_ManHour1_Unit = strCostBy; break; case "VM2": ioInfo.Cost_Var_ManHour2 = (inIsFixUnit ? decAmt : pmConvert2Sec(decAmt, strCostBy)); ioInfo.Cost_Var_ManHour2_Unit = strCostBy; break; case "VM3": ioInfo.Cost_Var_ManHour3 = (inIsFixUnit ? decAmt : pmConvert2Sec(decAmt, strCostBy)); ioInfo.Cost_Var_ManHour3_Unit = strCostBy; break; case "VM4": ioInfo.Cost_Var_ManHour4 = (inIsFixUnit ? decAmt : pmConvert2Sec(decAmt, strCostBy)); ioInfo.Cost_Var_ManHour4_Unit = strCostBy; break; case "VM5": ioInfo.Cost_Var_ManHour5 = (inIsFixUnit ? decAmt : pmConvert2Sec(decAmt, strCostBy)); ioInfo.Cost_Var_ManHour5_Unit = strCostBy; break; case "VP1": ioInfo.Cost_Var_ByOutput1 = decAmt; break; case "VP2": ioInfo.Cost_Var_ByOutput2 = decAmt; break; case "VP3": ioInfo.Cost_Var_ByOutput3 = decAmt; break; case "VP4": ioInfo.Cost_Var_ByOutput4 = decAmt; break; case "VP5": ioInfo.Cost_Var_ByOutput5 = decAmt; break; } } }
public static void GetCostLine(WS.Data.Agents.cDBMSAgent inSQLUtil, ref QCostLineInfo ioInfo, string inRefTab, string inMasterH, string inType, bool inIsFixUnit) { pmGetCostLine(inSQLUtil, ref ioInfo, inRefTab, inMasterH, inType, inIsFixUnit); }