public IBLDefinitions() { dalAccess = FactoryDAL.GetInstance(); Thread thread = new Thread(() => checkForExpiredOrders()); thread.Start(); }
// 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; } }
static MyBL() { string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS"); //string TypeDAL = "List"; MyDal = FactoryDAL.getDAL(TypeDAL); }
public Gensburger() { InitializeComponent(); this.Show(); this.TraineesCbx.ItemsSource = FactoryDAL.getInstance().GetTrainees(); TraineesCbx.DisplayMemberPath = "ID"; }
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); } }
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(); }
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(); }
// 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; } }
// 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; } }
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); }
// 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; } }
static IBL_imp() { string TypeDAL = ConfigurationSettings.AppSettings.Get("TypeDS"); MyDal = FactoryDAL.getDAL(TypeDAL); }
protected ABLL() { _tDAL = FactoryDAL.CreateDAL <TDTO>(); }
private void DalLayer_SelectedIndexChanged(object sender, EventArgs e) { Idal = FactoryDAL <IRepository <CustomerBase> > .Create(DalLayer.Text); LoadGrid(); }
static MyBL() { MyDal = FactoryDAL.getDAL(Configuration.DALType); }
public ClassBLAdapter() { DAL.Idal dal = FactoryDAL.getDAL(); }
// get dal object public Bl_imp() { dal = FactoryDAL.GetIDAL(); }
// 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; } }
// 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; } }