private static void FilltmpInfTarifDetRow(ref InfTariff infTariff) { DataRow rowTempInfDet = InfTariffDataTable.NewRow(); rowTempInfDet[0] = infTariff.TariffNetNum; rowTempInfDet[1] = infTariff.KindPay; rowTempInfDet[2] = infTariff.WorkerRate; rowTempInfDet[3] = infTariff.HourCost; InfTariffDataTable.Rows.Add(rowTempInfDet); }
private static InfTariff FillInfTarifItem(ODLDB210410DataSet.TARIFRow trow) { InfTariff infTariff = new InfTariff(); infTariff.KindPay = trow.VO; infTariff.HourCost = double.Parse(trow.STOIM_RAZR); infTariff.TariffNetNum = byte.Parse(trow.N_TARIF_SETKI); infTariff.WorkerRate = double.Parse(trow.RAZR.Replace('.', ',')); return(infTariff); }
public static void InsertFromTARIF() { foreach (var item in TarifDataTable) { InfTariff infTariff = FillInfTarifItem(item); FilltmpInfTarifDetRow(ref infTariff); } SqlCeBulkCopy bulkInsert = new SqlCeBulkCopy(connString); DataTable tmpInfTariff = InfTariffDataTable; if (tmpInfTariff.Rows.Count > 0) { bulkInsert.DestinationTableName = "infTariff"; bulkInsert.WriteToServer(tmpInfTariff); } bulkInsert.Close(); bulkInsert.Dispose(); tmpInfTariff.Dispose(); }