public IEnumerable <Customer> GetUserCustomers(string UserId) { IEnumerable <Customer> returnData; SPLog splog = new SPLog("GetAccountManagerDetailsSync"); try { returnData = _database.Query <Customer>( "web.GetUserCustomers", new { userid = UserId }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <AxOrderState> GetOrderStates(Customer customer, DateTime date) { IEnumerable <AxOrderState> returnData; SPLog splog = new SPLog("GetOrderStates", customer.DatabaseName, customer.CustomerId); try { returnData = _database.Query <AxOrderState>( "web.GetOrderStates" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId, date = date.Date }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public string GetOffRentEmailAddress(Customer customer, string SalesId) { string returnData; SPLog splog = new SPLog("GetOffRentEmailAddress", customer.DatabaseName, customer.CustomerId); try { returnData = _database.Query <string>( "web.GetOffRentEmailAddress" + customer.DatabaseName, new { companyid = customer.CompanyId, customer = customer.CustomerId, salesid = SalesId }, commandType: CommandType.StoredProcedure).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <RiwalCompany> GetRiwalCompany(string databaseName, string companyId) { RiwalCompany returnData; SPLog splog = new SPLog("GetRiwalCompanyById", databaseName); try { returnData = (await _database.QueryAsync <RiwalCompany>( "web.GetRiwalCompanyById", new { database = databaseName, companyid = companyId }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public Transfer GetCustomerTransferById(Customer customer, string transferId) { Transfer returnData; SPLog splog = new SPLog("GetCustomerTransferById", customer.DatabaseName, customer.CustomerId); try { returnData = (_database().Query <Transfer>( "web.GetCustomerTransferById" + customer.DatabaseName, new { companyid = customer.CompanyId, customerid = customer.CustomerId, transferid = transferId }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <RentalOrder> GetRentalOrdersByOffRent(string dataBase, DateTime date) { IEnumerable <RentalOrder> returnData; SPLog splog = new SPLog("GetRentalOrders", dataBase); try { returnData = _database.Query <RentalOrder>( "web.GetRentalOrdersByOffRent" + dataBase, new { date = date.Date }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public AccountManager GetAccountManagerDetails(Customer customer) { AccountManager returnData; SPLog splog = new SPLog("GetAccountManagerDetails", customer.DatabaseName, customer.CustomerId); try { returnData = _database.Query <AccountManager>( "web.GetAccountManagerDetails" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId }, commandType: CommandType.StoredProcedure).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <NewRentalProduct> GetCommercialFleetDetails(string id) { NewRentalProduct returnData; SPLog splog = new SPLog("GetCommercialFleetDetails"); try { returnData = (await _database.QueryAsync <NewRentalProduct>( "web.GetCommercialFleetDetails", new { id = id.ToString() }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
private IEnumerable <RentalOrder> GetProjectRentalOrders(string DatabaseName, string UserId) { IEnumerable <RentalOrder> returnData; SPLog splog = new SPLog("GetUserProjectRentalOrders", DatabaseName, UserId); try { returnData = _database.Query <RentalOrder>( "web.GetUserProjectRentalOrders" + DatabaseName, new { userid = UserId }, commandType: CommandType.StoredProcedure, commandTimeout: 950); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public NewRentalProduct GetCommercialFleetById(Customer customer, string id) { NewRentalProduct returnData; SPLog splog = new SPLog("GetCommercialFleetById", customer.DatabaseName, customer.CustomerId); try { returnData = _database.Query <NewRentalProduct>( "web.GetCommercialFleetById", new { id = id }, commandType: CommandType.StoredProcedure).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <TransferContact> GetCustomerTransferContacts(Customer customer) { IEnumerable <TransferContact> returnData; SPLog splog = new SPLog("GetCustomerTransferContacts", customer.DatabaseName, customer.CustomerId); try { returnData = _database().Query <TransferContact>( "web.GetCustomerTransferContacts", new { companyid = customer.CompanyId, customerid = customer.CustomerId }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public ContactPerson GetContactPersonById(string contactpersonid) { ContactPerson returnData; SPLog splog = new SPLog("GetContactPersonById"); try { returnData = _database.Query <ContactPerson>( "web.GetContactPersonById", new { contactpersonid = contactpersonid }, commandType: CommandType.StoredProcedure).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public RentalOrderDetails GetRentalOrderDetails(Customer customer, string invenTransId) { RentalOrderDetails returnData = new RentalOrderDetails(); SPLog splog = new SPLog("GetRentalOrderDetails", customer.DatabaseName, customer.CustomerId); try { returnData = _database.Query <RentalOrderDetails>( "web.GetRentalOrderDetails" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId, inventtransid = invenTransId }, commandType: CommandType.StoredProcedure).FirstOrDefault(); returnData.DatabaseName = customer.DatabaseName; splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <IEnumerable <RentalCosts> > GetRentalCostsInvoiceVenueAccount(Customer customer, DateTime StartDate, DateTime EndDate) { IEnumerable <RentalCosts> returnData; SPLog splog = new SPLog("GetRentalCostsInvoiceVenueAccount", customer.DatabaseName, customer.CustomerId); try { returnData = await _database().QueryAsync <RentalCosts>( "web.GetRentalCostsInvoiceVenueAccount" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId, startdate = StartDate, enddate = EndDate }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <IEnumerable <NewRentalProduct> > GetCommercialFleet(Customer customer) { IEnumerable <NewRentalProduct> returnData; SPLog splog = new SPLog("GetCommercialFleet", customer.DatabaseName, customer.CustomerId); try { returnData = await _database.QueryAsync <NewRentalProduct>( "web.GetCommercialFleet", new { companyid = customer.CompanyId }, commandType : CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <IEnumerable <NewRentalProductImage> > GetCommercialFleetImages(string productId) { IEnumerable <NewRentalProductImage> returnData; SPLog splog = new SPLog("GetCommercialFleetImages"); try { returnData = await _database.QueryAsync <NewRentalProductImage>( "web.GetCommercialFleetImages", new { productid = productId }, commandType : CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <Customer> GetUserCustomersSync(string UserId) { //TODO Add support for InspHire //if (customer.DatabaseName == DataBases.NetsuiteInsphire) // throw new NotImplementedException(); IEnumerable <Customer> returnData; SPLog splog = new SPLog("GetUserCustomersSync"); try { returnData = _database().Query <Customer>( "web.GetUserCustomers", new { userid = UserId }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <AccountManager> GetAccountManagerDetails(Customer customer) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetAccountManagerDetails(customer)); } AccountManager returnData; SPLog splog = new SPLog("GetAccountManagerDetails", customer.DatabaseName, customer.CustomerId); try { returnData = (await _database().QueryAsync <AccountManager>( "web.GetAccountManagerDetails" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <MachineNotInUseInfo> GetMachinesNotInUse(string databaseName, Customer customer, string daysNotInUse) { if (databaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetMachinesNotInUse(databaseName, customer, daysNotInUse)); } IEnumerable <MachineNotInUseInfo> returnData; SPLog splog = new SPLog("GetMachinesNotInUse", databaseName, customer.CustomerId); try { returnData = _database().Query <MachineNotInUseInfo>( "web.GetMachinesNotInUse" + databaseName, new { company = customer.CompanyId, customer = customer.CustomerId, days = daysNotInUse }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public Customer GetCustomer(string databaseName, string companyId, string customerId) { if (databaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetCustomer(databaseName, companyId, customerId)); } Customer returnData; SPLog splog = new SPLog("GetCustomer", databaseName, customerId); try { returnData = (_database().Query <Customer>( "web.GetCustomerRegisteredById" + databaseName, new { companyid = companyId, customerid = customerId }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <AccountManager> GetAccountManagerDetailsSync(Customer customer) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { throw new NotImplementedException(); } IEnumerable <AccountManager> returnData; SPLog splog = new SPLog("GetAccountManagerDetailsSync", customer.DatabaseName, customer.CustomerId); try { returnData = _database().Query <AccountManager>( "web.GetAccountManagerDetails" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <MaintenanceTask> GetMachineMaintenance(Customer customer, DateTime StartDate, DateTime EndDate, RentalOrderDetails orderDetails) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetMachineMaintenance(customer, StartDate, EndDate, orderDetails)); } IEnumerable <MaintenanceTask> returnData; SPLog splog = new SPLog("GetMachineMaintenance", customer.DatabaseName, customer.CustomerId); try { returnData = _database.QueryAsync <MaintenanceTask>( "web.GetMachineMaintenance", new { customer = customer.CustomerId, startdate = StartDate, enddate = EndDate, objectid = orderDetails.ObjectId }, commandType: CommandType.StoredProcedure).Result; splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <string> GetOffRentEmailAddress(Customer customer, string SalesId) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetOffRentEmailAddress(customer, SalesId)); } string returnData; SPLog splog = new SPLog("GetOffRentEmailAddress", customer.DatabaseName, customer.CustomerId); try { returnData = (await _database.QueryAsync <string>( "web.GetOffRentEmailAddress" + customer.DatabaseName, new { companyid = customer.CompanyId, customer = customer.CustomerId, salesid = SalesId }, commandType: CommandType.StoredProcedure)).FirstOrDefault(); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public IEnumerable <CustCosts> GetDWHCustCostPerVenu(string databaseName, string companyId, string customerId, string venueCode, DateTime beginDate, DateTime endDate) { if (databaseName == DataBases.NetsuiteInsphire) { throw new NotImplementedException(); } IEnumerable <CustCosts> returnData; SPLog splog = new SPLog("GetDWHCustCostPerVenu", databaseName, customerId); try { returnData = _database().Query <CustCosts>( "web.GetDWHCustCostPerVenu", new { company = companyId, customer = customerId, venue = venueCode, beginDate = beginDate.ToString("yyyy/MM/dd"), endDate = endDate.ToString("yyyy/MM/dd") }, commandType: CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <IEnumerable <Invoice> > GetInvoicesOrderAccountChildBR(Customer customer, DateTime StartDate, DateTime EndDate) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetInvoicesOrderAccountChildBR(customer, StartDate, EndDate)); } IEnumerable <Invoice> returnData; SPLog splog = new SPLog("GetInvoicesOrderAccountChildBR", customer.DatabaseName, customer.CustomerId); try { returnData = await _database.QueryAsync <Invoice>("web.GetInvoicesOrderAccountChildBR" + customer.DatabaseName, new { company = customer.CompanyId, customer = customer.CustomerId, startdate = StartDate, enddate = EndDate }, commandType : CommandType.StoredProcedure); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }
public async Task <IEnumerable <RentalProduct> > GetRentalProducts(Customer customer, string companyId) { if (customer.DatabaseName == DataBases.NetsuiteInsphire) { return(Helpers.InspHire.DAL.GetRentalProducts(customer, companyId)); } IEnumerable <RentalProduct> returnData; SPLog splog = new SPLog("GetRentalProducts", customer.DatabaseName, customer.CustomerId); try { returnData = (await _database.QueryAsync <RentalProduct>( "web.GetRentalProducts" + customer.DatabaseName, new { company = companyId }, commandType: CommandType.StoredProcedure)); splog.Log(); return(returnData); } catch (Exception e) { splog.LogError(e.GetType().Name + " - " + e.Message); throw new Exception("See inner exception", e); } }