Esempio n. 1
0
        public void parameterNegative_Test()
        {
            var _SearchEmployees = new BLEmployees();
            DTOResult <List <DTOEmployees> > resultExpected = new DTOResult <List <DTOEmployees> >();

            int _id = -1;

            var result = _SearchEmployees.SearchEmployeeId(_id);
        }
Esempio n. 2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //start chat
            IBLEmployees ibl = new BLEmployees(new DALEmployeesEF());

            ibl.InitChat();
        }
Esempio n. 3
0
 private void tsbDelete_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     try
     {
         string Username = GridListUser.GetFocusedRowCellValue("Username").ToString();
         BLEmployees.DeleteEmployee(Username);
     }
     catch (Exception)
     {
         MessageBox.Show("Chọn đúng dùm cái!");
     }
     LoadGrid();
     GridListUser.FocusRowHandle(GridListUser.ReturnVisibleRowCount - 1);
 }
Esempio n. 4
0
        public static void RegisterTypes(UnityContainer container)
        {
            //register the concrete implementation for interfaces
            container.RegisterType <IDALEmployees, DALEmployeesMock>();
            container.RegisterType <IBLEmployees, BLEmployees>();

            //register a singleton for DAL
            DALEmployeesMock dalEmployeesMock = new DALEmployeesMock();

            container.RegisterInstance(dalEmployeesMock);

            //register a singleton for BL
            BLEmployees blEmployees = new BLEmployees(container.Resolve <IDALEmployees>());

            container.RegisterInstance(blEmployees);
        }
Esempio n. 5
0
        public HttpResponseMessage SearchEmployees()
        {
            DTOResult <List <DTOEmployees> > resultAPIEmployees = new DTOResult <List <DTOEmployees> >();

            try
            {
                resultAPIEmployees = new BLEmployees().SearchEmployees();
                return(Request.CreateResponse(HttpStatusCode.OK, resultAPIEmployees));
            }
            catch (Exception ex)
            {
                resultAPIEmployees.Message = ex.Message.ToString();
                resultAPIEmployees.Result  = false;
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, resultAPIEmployees));
            }
        }
Esempio n. 6
0
        public void LoadGrid() //Get the employees list.
        {
            DataTable dt = BLEmployees.LoadEmployees();

            GridListUser.ItemsSource = dt;
        }