Example #1
0
        public LaborWage工作單品號Table GetData(string worksheetNumber)
        {
            SelectBy工作單號Cmd.Parameters["工作單號"].Value = worksheetNumber;

            LaborWage工作單品號Table table = new LaborWage工作單品號Table();

            Adapter.SelectCommand = SelectBy工作單號Cmd;
            Adapter.Fill(table);
            return(table);
        }
Example #2
0
        public LaborWage工作單品號Table GetDataGroupByPartNumber(List <string> worksheetNumberList)
        {
            LaborWage工作單品號Table table = new LaborWage工作單品號Table();

            if (worksheetNumberList.Count > 0)
            {
                string inQuery = " IN ( '" + string.Join("','", worksheetNumberList.ToArray()) + "' )";

                OleDbCommand cmd = new OleDbCommand();
                cmd.CommandText = "SELECT D.品號 AS 品號, Sum(val(Format(D.QTY*P.UnitPrice,'#'))) AS 外包工資 " +
                                  "FROM (Data as D INNER JOIN Product as P ON D.產品編號 = P.編號 AND D.外包品名編號 = P.外包品名編號) " +
                                  "WHERE 工作單號 " + inQuery +
                                  "GROUP BY D.品號";
                cmd.Connection = _connection;


                Adapter.SelectCommand = cmd;
                Adapter.Fill(table);
            }

            return(table);
        }