目的: V20107.cs 呼叫共用函式 get_STDHR(par_PN,par_WITM,par_DEP12) of V20107B *.cs
即 V20107 & V20107B 共用同一函式(*.cs get_STDHR)
處理說明: 將 get_STDHR 宣告為 static 函式, 以便直接呼叫該函式
1>V20107B.cs
namespace TLSWEB_AMM.Controllers
{ //更新工時 - HRUpd
public class V20107BAPIController : BaseAPIController
{
public static float get_STDHR(string par_PN,string par_WITM,string par_DEP12){
}
2>V20107.cs
public void Ins_AMM_WKSTPD4(string par_NEXT_MITM,string par_PN, List<string> par_SQLStringList, string par_DEP12){
string Tmp_MITM, Tmp_WITM, Tmp_STP, Tmp_AQTY, Tmp_PQTY;
float Tmp_WHR;
string Tmp_WHR_Str;
string Tmp_ENER, Tmp_ENDT;
string Tmp_Sql;
Tmp_MITM = par_NEXT_MITM;
Tmp_AQTY = "1";
Tmp_PQTY = "1";
Tmp_ENER = LoginUserModel.LoginUserId;
Tmp_ENDT= DateTime.Now.ToString("yyyy/MM/dd");
//新增 WITM='1'
Tmp_WITM = "1";
Tmp_STP = "進廠檢測";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) +","
+ myfunc.AA(Tmp_ENER) +","+ myfunc.AA(Tmp_ENDT)+ ") ";
par_SQLStringList.Add(Tmp_Sql);
//新增 WITM='2'
Tmp_WITM = "2";
Tmp_STP = "拆檢";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
Tmp_WITM = "2";
Tmp_STP = "拆檢";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
//新增 WITM='3'
Tmp_WITM = "3";
Tmp_STP = "組裝";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
//新增 WITM='4'
Tmp_WITM = "4";
Tmp_STP = "完工測試";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
}
Tmp_WITM = "3";
Tmp_STP = "組裝";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
//新增 WITM='4'
Tmp_WITM = "4";
Tmp_STP = "完工測試";
Tmp_WHR = V20107BAPIController.get_STDHR(par_PN, Tmp_WITM, par_DEP12);
Tmp_WHR_Str = Tmp_WHR.ToString();
Tmp_Sql = " INSERT INTO AMM_WKSTPD "
+ " ( MITM,WITM,STP,"
+ " AQTY,PQTY,WHR,ENER,ENDT) "
+ " VALUES "
+ " (" + myfunc.AA(Tmp_MITM) + "," + myfunc.AA(Tmp_WITM) + "," + myfunc.AA(Tmp_STP) + ","
+ myfunc.AA(Tmp_AQTY) + "," + myfunc.AA(Tmp_PQTY) + "," + myfunc.AA(Tmp_WHR_Str) + ","
+ myfunc.AA(Tmp_ENER) + "," + myfunc.AA(Tmp_ENDT) + ") ";
par_SQLStringList.Add(Tmp_Sql);
}
沒有留言:
張貼留言