public void Remove(FuelObject Fuel) { try { CheckTransaction(); new FuelDataService(Transaction).Remove(Fuel); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
public bool Remove(FuelObject fuel) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "Fuel_DELETE", CreateParameter("@fuelID", SqlDbType.UniqueIdentifier, fuel.FuelID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void ChangeFuelType(FuelObject fuel) { PlayerPrefs.SetString("FuelType", fuel.fuelName); Name.text = fuel.fuelName + " (" + fuel.fuelFormula + ")"; Type.text = fuel.fuelType.ToString() + " propellant"; DescriptionText.text = fuel.fuelDescription; }
public void Save(FuelObject fuel) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "Fuel_SAVE", CreateParameter("@fuelID", SqlDbType.UniqueIdentifier, fuel.FuelID, ParameterDirection.InputOutput), CreateParameter("@transi_TNR_reg", SqlDbType.Int, fuel.Transi_TNR_reg), CreateParameter("@transi_TNR_person", SqlDbType.Int, fuel.Transi_TNR_person), CreateParameter("@transi_TNR_mat", SqlDbType.Int, fuel.Transi_TNR_mat), CreateParameter("@transi_TNR_pump", SqlDbType.Int, fuel.Transi_TNR_pump), CreateParameter("@transi_TNR_tank", SqlDbType.Int, fuel.Transi_TNR_tank), CreateParameter("@transi_FuelType", SqlDbType.Int, fuel.Transi_FuelType), CreateParameter("@transc_FuelId", SqlDbType.Int, fuel.Transc_FuelId), CreateParameter("@transc_NawID", SqlDbType.Int, fuel.Transc_NawID), CreateParameter("@transc_Date", SqlDbType.Float, fuel.Transc_Date), CreateParameter("@transc_PriveBedrijf", SqlDbType.Int, fuel.Transc_PriveBedrijf), CreateParameter("@transc_Product", SqlDbType.NChar, fuel.Transc_Product), CreateParameter("@Date", SqlDbType.DateTime, fuel.Date), CreateParameter("@EmployeeName", SqlDbType.NChar, fuel.EmployeeName), CreateParameter("@Employee", SqlDbType.NChar, fuel.Employee), CreateParameter("@VehicleLicensePlate", SqlDbType.NChar, fuel.VehicleLicensePlate), CreateParameter("@VehicleKilometreCounter", SqlDbType.Int, fuel.VehicleKilometreCounter), CreateParameter("@Quantity", SqlDbType.Decimal, fuel.Quantity), CreateParameter("@QuantityCorrection", SqlDbType.Decimal, fuel.QuantityCorrection), CreateParameter("@Fulltank", SqlDbType.Decimal, fuel.FullTank), CreateParameter("@UnityPrice", SqlDbType.Decimal, fuel.UnityPrice), CreateParameter("@TotalPrice", SqlDbType.Decimal, fuel.TotalPrice), CreateParameter("@Unit", SqlDbType.Int, fuel.Unit), CreateParameter("@Supplier", SqlDbType.NChar, fuel.Supplier), CreateParameter("@Location", SqlDbType.NChar, fuel.Location), CreateParameter("@Fueltype", SqlDbType.Int, (int)fuel.FuelType), CreateParameter("@BTW", SqlDbType.Decimal, fuel.Btw), CreateParameter("@PrivateTanking", SqlDbType.Bit, fuel.PrivateTanking), CreateParameter("@CompanyTanking", SqlDbType.Bit, fuel.CompanyTanking), CreateParameter("@InvoiceReceived", SqlDbType.Bit, fuel.InvoiceReceived), CreateParameter("@InvoiceOK", SqlDbType.Bit, fuel.InvoiceReceived), CreateParameter("@DateMailForbiddenFueling", SqlDbType.VarChar, PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(fuel.DateMailForbiddenFueling)) ); fuel.FuelID = (Guid)cmd.Parameters["@fuelID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void AddDiscoveredFuel(FuelObject fuelObject) { // Only add fuel if it isn't discovered yet if (!m_discoveredFuel.Contains(fuelObject)) { m_discoveredFuel.Add(fuelObject); } else { Debug.Log(fuelObject.name + " has already been discovered!"); } }
public void SetFuelType(FuelObject fuel) { if (fuelTypeContainer.activeInHierarchy) { progressManager.SetCurrentFuel(fuel); ToggleFuelContainer(); UpdateImage(); if (m_IntroCanvasManager.currentState != IntroCanvasManager.State.Playing) { m_IntroCanvasManager.ToNextState(); } } else { Debug.LogWarning(gameObject.name + "Selected fuel type!"); } }
private void ConsumeFuel() { if (fuelSlot.item.Id != -1) { fuelObject = (FuelObject)fuelSlot.ItemObject; } if (fuelSlot.amount > 0 && fuelSlot.CanPlaceInSlot(fuelSlot.ItemObject) && fuel <= 0) { if (inventory.ConsumeItems(fuelSlot, 1)) { fuel += fuelObject.fuelPower; fuelSlot.UpdateSlot(fuelSlot.item, fuelSlot.amount--); fuelSlot.UpdateSlot(); animator.SetBool("IsWorking", true); isWorking = true; } } }
private void gdvFuel_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; FuelObject fuel = (FuelObject)view.GetRow(view.FocusedRowHandle); TIS.Client.Fuel.FuelDetail fuelDetail = new FuelDetail(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, fuel); if (fuelDetail.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Filter(); } } catch (System.Exception excepion1) { Cursor.Current = Cursors.Default; System.Exception thisException = excepion1; Management.ShowException(thisException); } }
public FuelDetail(PROF_IT.Common.Enumerations.TypeForm typeForm) { try { InitializeComponent(); _typeForm = typeForm; if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm) { FuelMember = new FuelObject(); FindAll(); } else { throw new NotImplementedException(); } SetPermissions(); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
private void btnImportTotal_Click(object sender, EventArgs e) { try { try { OpenFileDialog ofdImport = new OpenFileDialog(); ofdImport.Title = "Select file"; ofdImport.Filter = "Excel Sheet(*.xlsx)|*.xlsx|Excel Sheet 2003(*.xls)|*.xls|All Files(*.*)|*.*"; ofdImport.FilterIndex = 1; ofdImport.RestoreDirectory = true; if (ofdImport.ShowDialog() != DialogResult.OK) return; string connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0; data source={0}; Extended Properties=Excel 12.0;", ofdImport.FileName); OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Download factuur in Excel$]", connectionString); DataSet ds = new DataSet(); adapter.Fill(ds); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr[18].ToString() == "" || dr[18].ToString().Trim() == "hoeveelheid") // Do not import header or empty rows from Excel continue; Enumeration.Fuel.FuelType fuelType; switch(dr[17].ToString().ToLower()) { case "adblue": fuelType = Enumeration.Fuel.FuelType.Unknown ; break; case "diesel 10 ppm": fuelType = Enumeration.Fuel.FuelType.Diesel ; break; case "excellium diesel": fuelType = Enumeration.Fuel.FuelType.Diesel ; break; default: fuelType = Enumeration.Fuel.FuelType.Unknown; break; } string currency = dr[28].ToString().ToLower().Trim(); if (currency.ToLower() != "eur" && currency.ToLower() != "pln") { XtraMessageBox.Show("Wisselkoers niet gekend", "De wisselkoers " + currency + "is niet gekend!" , MessageBoxButtons.OK, MessageBoxIcon.Warning); continue; } if (fuelType == Enumeration.Fuel.FuelType.Diesel) { string licenseplate = ""; string employeename = ""; if (dr[12].ToString() != "") { int space1 = dr[12].ToString().IndexOf(' '); licenseplate = dr[12].ToString().Substring(0, space1); employeename = dr[12].ToString().Substring(space1 + 1); } TIS.DL.Internal.Fuel.FuelObject fuelObj = new FuelObject(); fuelObj.Btw = Convert.ToDecimal(dr[21].ToString()); fuelObj.CompanyTanking = false; fuelObj.Date = Convert.ToDateTime(dr[15].ToString()); fuelObj.Employee = employeename; fuelObj.EmployeeName = employeename; fuelObj.FuelType = fuelType; fuelObj.InvoiceOK = false; fuelObj.InvoiceReceived = false; fuelObj.Location = dr[26].ToString() + " -- " + dr[30].ToString(); fuelObj.PrivateTanking = false; fuelObj.Quantity = Convert.ToDecimal(dr[18].ToString()); fuelObj.QuantityCorrection = 0; fuelObj.Supplier = "TOTAL"; fuelObj.TotalPrice = Convert.ToDecimal(dr[20].ToString()); fuelObj.UnityPrice = Convert.ToDecimal(dr[20].ToString()) / Convert.ToDecimal(dr[18].ToString()); fuelObj.VehicleKilometreCounter = Convert.ToInt32(Math.Round(Convert.ToDecimal(dr[31].ToString()),0)); fuelObj.VehicleLicensePlate = licenseplate; if (currency == "pln") { decimal pln = Convert.ToDecimal(txtPLNCurrency.Text); fuelObj.Btw = fuelObj.Btw / pln; fuelObj.TotalPrice = fuelObj.TotalPrice / pln; fuelObj.UnityPrice = fuelObj.UnityPrice / pln; } TIS.BL.Internal.Fuel fuelBL = new BL.Internal.Fuel(); fuelBL.Save(fuelObj); } } XtraMessageBox.Show("Geïmporteerd", "Bestand is geïmporteerd.", MessageBoxButtons.OK, MessageBoxIcon.Warning); Filter(); } catch (System.Exception excepion1) { System.Exception thisException = excepion1; Management.ShowException(thisException); } } catch (System.Exception excepion1) { System.Exception thisException = excepion1; Management.ShowException(thisException); } }
public void SetCurrentFuel(FuelObject fuelObject) { m_currentFuel = fuelObject; }