Exemplo n.º 1
0
        public IBLDefinitions()
        {
            dalAccess = FactoryDAL.GetInstance();
            Thread thread = new Thread(() => checkForExpiredOrders());

            thread.Start();
        }
Exemplo n.º 2
0
        // Methode qui retourne un bool en fonctione du status Factory
        public static bool CheckStatus(FactoryBO factory)
        {
            try
            {
                List<FactoryBO> listResult = new List<FactoryBO>();
                FactoryBO result = new FactoryBO();
                FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());

                listResult = dal.FactoryBO_FindById(factory.id_factory).ToList();
                result = listResult.FirstOrDefault();

                if (result.status == "true")
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 3
0
        static MyBL()
        {
            string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS");

            //string TypeDAL = "List";
            MyDal = FactoryDAL.getDAL(TypeDAL);
        }
Exemplo n.º 4
0
 public Gensburger()
 {
     InitializeComponent();
     this.Show();
     this.TraineesCbx.ItemsSource  = FactoryDAL.getInstance().GetTrainees();
     TraineesCbx.DisplayMemberPath = "ID";
 }
Exemplo n.º 5
0
        private void btnUOW_Click(object sender, EventArgs e)
        {
            IUow uow = FactoryDAL <IUow> .Create("EFUow");

            try
            {
                CustomerBase cust1 = new CustomerBase();
                cust1.CustomerType = "Lead";
                cust1.CustomerName = "Cust1";
                cust1.BillDate     = Convert.ToDateTime(txtBillingDate.Text);
                IRepository <CustomerBase> dal1 = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text);

                dal1.SetUnitOfWork(uow);
                dal1.Add(cust1);

                CustomerBase cust2 = new CustomerBase();
                cust2.CustomerType = "Lead";
                cust2.CustomerName = "Cust2";
                cust2.BillDate     = Convert.ToDateTime(txtBillingDate.Text);
                cust2.Address      = "111111111111111111111111111111111111111111111111111111111111111";
                IRepository <CustomerBase> dal2 = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text);

                dal2.SetUnitOfWork(uow);
                dal2.Add(cust2);

                uow.Commit();
            }
            catch (Exception ex)
            {
                uow.RollBack();
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 6
0
        private void FrmCustomer_Load(object sender, EventArgs e)
        {
            DalLayer.Items.Add("ADODal");
            DalLayer.Items.Add("EFDal");
            DalLayer.SelectedIndex = 0;

            Idal = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text);

            ClearCustomer();
            LoadGrid();
        }
Exemplo n.º 7
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     _DALtype = comboBox1.Text;
     try
     {
         dal = FactoryDAL <IDAL <CustomerBase> > .getDal(_DALtype);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Unable to create DAL : " + ex.Message);
     }
     LoadGrid();
 }
Exemplo n.º 8
0
        // Méthode Delete Factory
        public static void Delete(int id_factory)
        {
            try
            {
                FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());
                dal.FactoryBO_Delete(id_factory);
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 9
0
 // Méthode qui retourne la dernière Factory créée
 public static FactoryBO FindLast()
 {
     try
     {
         FactoryBO result = new FactoryBO();
         FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());
         result = dal.FactoryBO_FindLast().FirstOrDefault();
         return result;
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 10
0
        public KumasAndIplikUOW(string ConnectionString = null)
        {
            if (ConnectionString == null)
            {
                Context = new KumasAndIplikContext(ConnectionStringGetter.Get());
            }
            else
            {
                Context = new KumasAndIplikContext(ConnectionString);
            }

            CrashRegister       = new CrashRegisterDAL(Context);
            Factory             = new FactoryDAL(Context);
            Machine             = new MachineDAL(Context);
            MachineComponent    = new MachineComponentDAL(Context);
            StenterMachine      = new StenterMachineDAL(Context);
            Employee            = new EmployeeDAL(Context);
            ManipulatorEmployee = new ManipulatorEmployeeDAL(Context);
        }
Exemplo n.º 11
0
        // Méthode Insert Factory
        public static FactoryBO Insert(FactoryBO factory)
        {
            try
            {
                FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());
                dal.FactoryBO_Insert(
                    factory.type,
                    factory.factory_stock,
                    factory.factory_location,
                    factory.toy_production_time,
                    factory.toy_current_production,
                    factory.status
                    );
                return factory;
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 12
0
        static IBL_imp()
        {
            string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS");

            MyDal = FactoryDAL.getDAL(TypeDAL);
        }
Exemplo n.º 13
0
 protected ABLL()
 {
     _tDAL = FactoryDAL.CreateDAL <TDTO>();
 }
Exemplo n.º 14
0
        private void DalLayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            Idal = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text);

            LoadGrid();
        }
Exemplo n.º 15
0
 static MyBL()
 {
     MyDal = FactoryDAL.getDAL(Configuration.DALType);
 }
Exemplo n.º 16
0
 public ClassBLAdapter()
 {
     DAL.Idal dal = FactoryDAL.getDAL();
 }
Exemplo n.º 17
0
 // get dal object
 public Bl_imp()
 {
     dal = FactoryDAL.GetIDAL();
 }
Exemplo n.º 18
0
        // Méthode retourne la Factory en fonction de ID Factory
        public static FactoryBO SearchById(int id_factory)
        {
            try
            {
                List<FactoryBO> listResult = new List<FactoryBO>();
                FactoryBO result = new FactoryBO();
                FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());

                listResult = dal.FactoryBO_FindById(id_factory).ToList();
                result = listResult.FirstOrDefault();
                return result;
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 19
0
        // Méthode Update Factory
        public static void Update(FactoryBO factory)
        {
            try
            {
                FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion());
                dal.FactoryBO_Update(
                    factory.id_factory,
                    factory.type,
                    factory.factory_stock,
                    factory.factory_location,
                    factory.toy_production_time,
                    factory.toy_current_production,
                    factory.status
                    );
            }
            catch (Exception)
            {

                throw;
            }
        }