public void TestNewClassesAndInterfaces() { ///create a new concrete implementation of the /// Customer testCusti = Customer.GetSingleCustomer(1); Customer blankCust = new Customer(); CustomerBankDetail aBankDetail = CustomerBankDetail.GetCustomerBankDetailFromCustomer(testCusti); testCusti.EmailAddress = "*****@*****.**"; testCusti.Town = "london"; ICustomerSet testMeCustomer = new CustomerSet(testCusti); //right, so do we have the right events dere eh? var theEvents = testMeCustomer.theEventsChainToComplete.CheckRemainingEvents(); var isItFalse = testMeCustomer.theEventsChainToComplete.CheckIfBookingComplete(); var nextEvent = testMeCustomer.theEventsChainToComplete.CheckNextEvent(); testMeCustomer.theEventsChainToComplete.EventComplete_RemoveFromRemainingEvents(nextEvent); var howManyEventsWeGot = testMeCustomer.theEventsChainToComplete.CheckRemainingEvents().Count(); }
/// <summary> /// 服務申請書對應客戶資料 /// </summary> /// <param name="accftt"></param> public static CustomerSet SetCustomer(ACCFTT accftt, CustomerSet customerSet) { if (null == customerSet) { customerSet = new CustomerSet(); } if (null == customerSet.Customer) { customerSet.Customer = new CustomerModel(); } string custId = accftt.IDCODE.TrimStart('0'); customerSet.Customer.CustomerId = custId; customerSet.Customer.CustomerName = accftt.CUSTNAME; //customerSet.Customer.DeptId = accftt.APPBECODE; //customerSet.Customer.BillTermLen = 3;//默認三碼 //customerSet.Customer.PayerNoLen = 6;//默認六碼 //customerSet.Customer.IsSysCust = false; return(customerSet); }
private void onSave() { using (var dc = new CustomerDB()) { string mvFirstName = FileparseFirstName; string mvLastName = FileparseLastName; string mvAge = FileparseAge; string mvAddressStreet = FileparseAddressStreet; string mvAddressCity = FileparseAddressCity; string mvAddressState = FileparseAddressState; string mvAddressCode = FileparseAddressCode; string mvPhone = FileparsePhone; string mvPhoneF = FileparsePhoneF; var mv = new CustomerSet() { FirstName = mvFirstName, LastName = mvLastName, Age = mvAge }; var address = new Address() { StreetAddress = FileparseAddressStreet, City = FileparseAddressCity, State = FileparseAddressState, PostalCode = FileparseAddressCode }; var pone = new PhoneNumber() { Type = FileparseType, Number = FileparsePhone }; var phoneF = new PhoneNumber() { Type = FileparseTypeF, Number = FileparsePhoneF }; mv.Addresses.Add(address); mv.PhoneNumbers.Add(pone); mv.PhoneNumbers.Add(phoneF); dc.CustomerSet.Add(mv); dc.SaveChanges(); MessageBox.Show("snimljeno"); } }
/// <summary> /// 獲取客戶資料 /// </summary> /// <param name="model"></param> /// <param name="bizCustomerSet"></param> /// <param name="customerSet"></param> private void GetCustomerInfo(ACCFTT model, BizCustomerRepository bizCustRepo, CustomerRepository custRepo, CustUserRepository custUserRepo, out BizCustomerSet bizCustomerSet, out CustomerSet customerSet, out CustUserSet custUserSet) { bizCustomerSet = bizCustRepo.QueryData(new object[] { model.KEYNO }); customerSet = custRepo.QueryData(new object[] { model.IDCODE.TrimStart('0') }); custUserSet = custUserRepo.QueryData(new object[] { $"{model.IDCODE.TrimStart('0')},admin" }); }