public LocalLearnerModel CancelBooking(System.String bookId, System.String userLoginId) { //Update person details DelegateRecord record = this.Provider.DataProvider.Learning.Learner.CancelBooking(bookId, userLoginId); LocalLearnerModel model = record == null ? null : new LocalLearnerModel(this.Provider, record); return model; }
public LocalLearnerModel DelegatesToConfirm(System.String bookId, System.String approver) { //Update person details DelegateRecord record = this.Provider.DataProvider.Learning.Learner.DelegatesToConfirm(bookId,approver); LocalLearnerModel model = record == null ? null : new LocalLearnerModel(this.Provider, record); return model; }
public override void Modify(DelegateRecord record) { DbCommand command = this.Provider.GetStoredProcedure("spInsertUpdateDelegate"); this.MapParameterIn(command, "@PA_USER_LOGIN_ID", "dev"); this.MapParametersIn(command, record, true); this.Execute(command); this.MapParametersOut(command, record); }
public string CreateDonationProduct(string personName, string surname, string email, string phone, string price, string productId) { var addressId = "11"; var sellingCompanyId = "1"; var organisationId = "1"; var person = new PersonRecord() { FirstName = personName, Surname = surname, HomeAddId = addressId }; this.Provider.DataProvider.Contact.Person.Create(person); var addedPerson = this.Provider.DataProvider.Contact.Person.FetchAll().OrderByDescending(x => x.AddDate).FirstOrDefault(); var role = new PersonRoleRecord() { PersonId = addedPerson.Id, Email = email, Phone = phone, SelcoSpId = sellingCompanyId, OrgId = organisationId, AddId = addressId }; this.Provider.DataProvider.Contact.Role.Create(role); var addedRole = this.Provider.DataProvider.Contact.Role.FetchAll().OrderByDescending(x => x.AddDate).FirstOrDefault(); var booking = new BookingRecord() { ProleId = addedRole.Id, InvOrgId = addedRole.OrgId, SelcoSpId = addedRole.SelcoSpId, PaymentMethd = "05-Cash", CurrencyType = "GBP", NetTotal = Convert.ToInt32(price), PersonId = addedRole.PersonId }; this.Provider.DataProvider.Learning.Booking.Create(booking); var addedBooking = this.Provider.DataProvider.Learning.Booking.FetchAll().OrderByDescending(x => x.AddDate).FirstOrDefault(); var donationProduct = this.Provider.DataProvider.Learning.Product.FetchById(productId); var delegateRecord = new DelegateRecord() { BookId = addedBooking.Id, OrgId = addedBooking.OrgId, PersonId = addedBooking.PersonId, ProleId = addedBooking.ProleId, ProductId = donationProduct.Id, Quantity = 1 }; this.Provider.DataProvider.Learning.Learner.Create(delegateRecord); var addedDelegate = this.Provider.DataProvider.Learning.Learner.FetchAll().OrderByDescending(x => x.AddDate).FirstOrDefault(); var element = new ElementRecord() { BookId = addedBooking.Id, PaymentMethd = "01-Invoice", ProdId = donationProduct.Id, SelcoSpId = sellingCompanyId, Type = 29, Price = Convert.ToInt32(price), Description = donationProduct.Descrip, CostCode = donationProduct.CostCode, Qty = 1, UntPrice = Convert.ToInt32(price), PlId = "1", DelId = addedDelegate.Id }; this.Provider.DataProvider.Learning.Element.Create(element); return("/learning/donationbooking?id=" + addedBooking.Id); }