public ResponseModel CreatePhoneProvider(PhoneProvider prov) { ResponseModel resp = new ResponseModel(); try { SqlDataReader oread = SqlHelper.ExecuteReader( MySettings.ConnEAMAdmin, "[dbo].sp_admin_AddPhoneProvider", prov.Address, prov.Description, prov.FromLength, prov.MaxLength ); oread.Read(); int iId = Convert.ToInt32(oread["Id"].ToString()); oread.Close(); if (iId > 0) { resp.response = true; resp.identity = iId; resp.message = "ok|Proveedor ADICIONADO|Prov Tel Mgr|n"; } oread.Close(); } catch (Exception ex) { resp.message = "er|Proveedor NO ADICIONADO (" + ex.Message + ")|Prov Tel Mgr|" + prov.PhoneProviderId.ToString(); } return(resp); }
public ResponseModel UpdatePhoneProvider(PhoneProvider prov) { ResponseModel resp = new ResponseModel(); try { //UPDATE dbo.AspNetRoles int uResult = SqlHelper.ExecuteNonQuery( MySettings.ConnEAMAdmin, "[dbo].sp_admin_UpdatePhoneProvider", prov.PhoneProviderId, prov.Address, prov.Description, prov.FromLength, prov.MaxLength ); resp.response = true; resp.message = "ok|Proveedor ACTUALIZADO|Prov Tel Mgr|u"; } catch (Exception ex) { resp.message = "er|Proveedor NO ACTUALIZADO (" + ex.Message + ")|Prov Tel Mgr|" + prov.PhoneProviderId.ToString(); } return(resp); }
public IMapping Phone(string field, string template) { PhoneProvider provider = new PhoneProvider(template); listOfFields.Add(field, provider); return(this); }
public void ConstructorWithPhoneProvider() { IDataProvider provider = new PhoneProvider("(0-xxx) xxx xx xx"); var settings = new JsonFieldSettings("phone", provider); Assert.Equal("phone", settings.Fields); Assert.Equal("(0-xxx) xxx xx xx", settings.Value); Assert.Equal(ProviderType.Phone.ToString(), settings.Type); }
public void ValidFormatWithIDataProviderString() { var format = "(0-xxx) xxx-xx-xxx"; IDataProvider <string> provider = new PhoneProvider(format); provider.MoveNext(null); Assert.Equal(format.Length, provider.Current.Length); }
public void ValidFormatWithPhoneProvider() { var format = "(0-xxx) xxx-xx-xxx"; PhoneProvider provider = new PhoneProvider(format); provider.MoveNext(null); Assert.Equal(format.Length, provider.Current.Length); }
[Inject] // Using Ninject for DI public BaseController( AddressProvider AddressProvider, EmailProvider EmailProvider, PhoneProvider PhoneProvider) { this.AddressProvider = AddressProvider; this.EmailProvider = EmailProvider; this.PhoneProvider = PhoneProvider; }
public AdministrationController( CustomerProvider CustomerProvider, EmployeeProvider EmployeeProvider, AddressProvider AddressProvider, EmailProvider EmailProvider, PhoneProvider PhoneProvider) : base(AddressProvider, EmailProvider, PhoneProvider) { this.CustomerProvider = CustomerProvider; this.EmployeeProvider = EmployeeProvider; }
public void Delete(int id) { var PhoneProvider = new PhoneProvider { PhoneProviderId = id }; unitOfWork.PhoneProviderRepositoy.Delete(PhoneProvider); unitOfWork.Save(); }
public void Create(PhoneProviderViewModel phoneProviderVM) { var PhoneProvider = new PhoneProvider { PhoneProviderName = phoneProviderVM.PhoneProviderName }; unitOfWork.PhoneProviderRepositoy.Insert(PhoneProvider); unitOfWork.Save(); }
public void Update(PhoneProviderViewModel phoneProviderVM) { var PhoneProvider = new PhoneProvider { PhoneProviderId = phoneProviderVM.PhoneProviderId, PhoneProviderName = phoneProviderVM.PhoneProviderName }; unitOfWork.PhoneProviderRepositoy.Update(PhoneProvider); unitOfWork.Save(); }
public List <PhoneProvider> GetPhoneProviders() { ResponseModel resp = new ResponseModel(); List <PhoneProvider> provs = new List <PhoneProvider>(); PhoneProvider prov; try { SqlDataReader datos = SqlHelper.ExecuteReader(MySettings.ConnEAMAdmin , "dbo.sp_admin_GetPhoneProviders" , 0 ); if (datos.HasRows) { while (datos.Read()) { prov = new PhoneProvider(); prov.PhoneProviderId = (int)datos["PhoneProviderId"]; prov.Address = datos["Address"].ToString(); prov.Description = datos["Description"].ToString(); prov.FromLength = (int)datos["fromLength"]; prov.MaxLength = (int)datos["maxLength"]; provs.Add(prov); } } datos.Close(); } catch (Exception ex) { var message = ex.Message; } return(provs); }
private void MainPage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) { _observableDictionary["MainViewModel"] = new MainViewModel(new ClientProvider()); //((MainViewModel)DataContext).LoadData(); _observableDictionary["Phones"] = new PhoneProvider().LoadPhones(); }
public PhoneController() { phoneProvider = new PhoneProvider(); }