Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IDataLayer <CustomerBase> dalcust = FactoryDal <CustomerBase> .getDal("EfCustDal");

            IDataLayer <AddressBase> daladd = FactoryDal <AddressBase> .getDal("EfAddDal");

            IDataLayer <PhoneBase> dalphone = FactoryDal <PhoneBase> .getDal("EfPhoneDal");

            Mediator.Mediator obj = new Mediator.Mediator(dalcust, daladd, dalphone);
            CustomerBase      c   = Factory <CustomerBase> .Create("Customer");

            c.CustomerName = "tesy123";
            c.PhoneNumber  = "90909";
            c.BillDate     = Convert.ToDateTime("1/1/2010");
            c.Type         = "Customer";
            c.BillAmount   = 100;
            obj.Add(c);
            AddressBase a = Factory <AddressBase> .Create("Address");

            a.Address1 = "Mulund";
            obj.Add(a);
            PhoneBase p = Factory <PhoneBase> .Create("Phone");

            p.PhoneNumber = "222";
            obj.Add(p, 0);
            obj.SaveAll();
        }
Exemplo n.º 2
0
        public void Add(PhoneBase phone, int index)
        {
            Phone p = new Phone();

            p.PhoneNumber = phone.PhoneNumber;
            cust.Addresses[index].Phones.Add(p);
        }
Exemplo n.º 3
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(PhoneBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_GetName, serviceImpl.GetName)
            .AddMethod(__Method_GetNameRequestStream, serviceImpl.GetNameRequestStream)
            .AddMethod(__Method_GetNameResponseStream, serviceImpl.GetNameResponseStream)
            .AddMethod(__Method_GetNameBiDiStream, serviceImpl.GetNameBiDiStream).Build());
 }
Exemplo n.º 4
0
    static private string sendMsgInfo(string phone, string content)
    {
        string    use       = WebConfigurationManager.AppSettings["use"];
        PhoneBase phoneBase = null;

        if (use == "1")
        {
            phoneBase = new PhoneCom1();
        }
        else if (use == "2")
        {
            phoneBase = new PhoneCom2();
        }
        else
        {
            phoneBase = new PhoneCom3();
        }
        return(phoneBase.sendMsgInfo(phone, content));
    }
Exemplo n.º 5
0
        public WriteAllResult WriteAll()
        {
            UpdateAll();

            if (PcBase != null && !PcBase.WriteChanges())
            {
                return(WriteAllResult.FailedPc);
            }

            if (PhoneBase != null && !PhoneBase.WriteChanges())
            {
                return(WriteAllResult.FailedPhone);
            }

            if (PsdBase != null && !PsdBase.WriteChanges())
            {
                return(WriteAllResult.FailedPsd);
            }

            return(WriteAllResult.Success);
        }
 public void Init()
 {
     instance = new PhoneBase();
 }