コード例 #1
0
        public IBLDefinitions()
        {
            dalAccess = FactoryDAL.GetInstance();
            Thread thread = new Thread(() => checkForExpiredOrders());

            thread.Start();
        }
コード例 #2
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
        // 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;
            }
        }
コード例 #3
0
        static MyBL()
        {
            string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS");

            //string TypeDAL = "List";
            MyDal = FactoryDAL.getDAL(TypeDAL);
        }
コード例 #4
0
 public Gensburger()
 {
     InitializeComponent();
     this.Show();
     this.TraineesCbx.ItemsSource  = FactoryDAL.getInstance().GetTrainees();
     TraineesCbx.DisplayMemberPath = "ID";
 }
コード例 #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);
            }
        }
コード例 #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();
        }
コード例 #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();
 }
コード例 #8
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
        // 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;
            }
        }
コード例 #9
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
 // 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;
     }
 }
コード例 #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);
        }
コード例 #11
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
        // 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;
            }
        }
コード例 #12
0
        static IBL_imp()
        {
            string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS");

            MyDal = FactoryDAL.getDAL(TypeDAL);
        }
コード例 #13
0
ファイル: ABLL.cs プロジェクト: vitor97lima/source
 protected ABLL()
 {
     _tDAL = FactoryDAL.CreateDAL <TDTO>();
 }
コード例 #14
0
        private void DalLayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            Idal = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text);

            LoadGrid();
        }
コード例 #15
0
 static MyBL()
 {
     MyDal = FactoryDAL.getDAL(Configuration.DALType);
 }
コード例 #16
0
 public ClassBLAdapter()
 {
     DAL.Idal dal = FactoryDAL.getDAL();
 }
コード例 #17
0
 // get dal object
 public Bl_imp()
 {
     dal = FactoryDAL.GetIDAL();
 }
コード例 #18
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
        // 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;
            }
        }
コード例 #19
0
ファイル: FactoryBL.cs プロジェクト: ChristmasVillage/Project
        // 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;
            }
        }