Esempio n. 1
0
        protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlItem.SelectedIndex > 0)
            {
                cblBranches.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                cblBranches.DataValueField = "ID";
                cblBranches.DataTextField  = "Name";
                cblBranches.DataBind();

                foreach (ListItem item in cblBranches.Items)
                {
                    item.Selected = false;
                }

                int[] branchesID = ItemService.GetBranchesByItem(Convert.ToInt32(ddlItem.SelectedValue)).ToArray();
                foreach (var branchID in branchesID)
                {
                    cblBranches.Items.FindByValue(branchID.ToString()).Selected = true;
                }

                btnSave.Enabled = true;
            }
            else
            {
                cblBranches.DataSource = null;
                cblBranches.DataBind();
            }
        }
Esempio n. 2
0
        public ActionResult Edit(int id)
        {
            // For Bind Company
            #region Company Bind
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();

            EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem();
            objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>();
            objEmpWorkHistoryItem.CompanyList.AddRange(objCompany);

            #endregion

            //For Bind Branch
            #region  Bind Branch
            List <BranchItem> objbranchitm     = new List <BranchItem>();
            BranchService     objbranchservice = new BranchService();
            objbranchitm = objbranchservice.GetAll();

            //objEmpItem = new EmployeeItem();
            objEmpWorkHistoryItem.BranchList = new List <BranchItem>();
            objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm);

            // for designation ddl
            WorkHistoryService objWorkHistoryService = new WorkHistoryService();
            objEmpWorkHistoryItem = objWorkHistoryService.GetByPk(id);
            #endregion

            return(View(objEmpWorkHistoryItem));
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblBrowser.Text = String.Format("{0} - {1} {2}", Request.Browser.Type, Request.Browser.Version, Request.Browser.Platform);
            using (var entities = new FitnessEntities())
            {
                using (var connection = entities.Connection)
                {
                    if (connection.State != ConnectionState.Open)
                    {
                        connection.Open();
                    }

                    lblDatabaseServer.Text = String.Format("{0} on {1} ({2})",
                                                           entities.Connection.Database,
                                                           entities.Connection.DataSource,
                                                           entities.Connection.ServerVersion);
                }
            }
            bulBranch.DataSource    = BranchService.GetActiveBranches(User.Identity.Name);
            bulBranch.DataTextField = "Name";
            bulBranch.DataBind();

            bulAllowedBranch.DataSource    = BranchService.GetAllowedBranches(User.Identity.Name);
            bulAllowedBranch.DataTextField = "Name";
            bulAllowedBranch.DataBind();

            hypAlerts.Visible = !String.IsNullOrEmpty(Request["FromAlert"]);

            if (!Page.IsPostBack)
            {
                RadScheduler1.SelectedDate = DateTime.Today;
                BindData();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates Service to work with branches.
        /// </summary>
        /// <returns>Instance that implements IBranchService.</returns>
        public IBranchService CreateBranchService()
        {
            var sender        = new HttpRequestSender(this.accessToken);
            var branchService = new BranchService(sender);

            return(branchService);
        }
Esempio n. 5
0
 public BranchesViewModel(INavigationService navigationService)
 {
     _navigationService   = navigationService;
     _branchService       = new BranchService();
     _subscriptionService = new SubscriptionService();
     _userService         = new UserService();
 }
Esempio n. 6
0
        public ActionResult Edit(int id)
        {
            BranchService objBranch = new BranchService();
            BranchItem objBItem = new BranchItem();
            objBItem = objBranch.GetById(id);
            //Session["Empid"] = objPassItem.EmpId;
            List<BranchItem> lstBranch = new List<BranchItem>();
            objBItem.ListBranch = new List<BranchItem>();
            objBItem.ListBranch.AddRange(lstBranch);
            ViewBag.Menuid = Request.QueryString["menuId"];
            #region Bind DropDown Country
            List<clsMasterData> lstMasters = new List<clsMasterData>();
            lstMasters = objBranch.getCountry();
            objBItem.ListCon = new List<clsMasterData>();
            objBItem.ListCon.AddRange(lstMasters);

            #endregion
            #region Bind DropDown Comp
            List<CompanyItem> lstComp = new List<CompanyItem>();
            lstComp = objBranch.GetAllComp();
            objBItem.ListComp = new List<CompanyItem>();
            objBItem.ListComp.AddRange(lstComp);
            #endregion
            return View(objBItem);
        }
Esempio n. 7
0
        //
        // GET: /Branch/     
        public ActionResult Create()
        {
            BranchService objBranch = new BranchService();
            BranchItem objItem = new BranchItem();
            List<BranchItem> lstBranch = new List<BranchItem>();
            int cid = 0;
            if (Session["CompID"] != null)
            {
                cid = Convert.ToInt32(Session["CompID"].ToString());
            }
            lstBranch = objBranch.getBranch(cid);
            objItem.ListBranch = new List<BranchItem>();
            objItem.ListBranch.AddRange(lstBranch);
            #region Bind DropDown Country
            List<clsMasterData> lstMasters = new List<clsMasterData>();
            lstMasters = objBranch.getCountry();
            objItem.ListCon = new List<clsMasterData>();
            objItem.ListCon.AddRange(lstMasters);

            #endregion
            #region Bind DropDown Comp
            List<CompanyItem> lstComp = new List<CompanyItem>();
            lstComp = objBranch.GetAllComp();
            objItem.ListComp = new List<CompanyItem>();
            objItem.ListComp.AddRange(lstComp);
            #endregion
            ViewBag.Menuid = Request.QueryString["menuId"];
            return View(objItem);
        }
Esempio n. 8
0
 public CommitViewModel(Guid repositoryId)
 {
     _repositoryId    = repositoryId;
     _gitManager      = new GitManager();
     _branchService   = new BranchService();
     _commitService   = new CommitService();
     _branches        = new ObservableCollection <Branch>(_branchService.GetBranches(_repositoryId));
     _commits         = new ObservableCollection <CommitDto>(_branchService.GetBranches(_repositoryId).CreateCommitsDto());
     _changedFiles    = new ObservableCollection <string>(_gitManager.GitStatusAsync(_repositoryId).Result);
     _stage           = new ObservableCollection <string>();
     _visibility      = Visibility.Hidden;
     _mergeVisibility = Visibility.Hidden;
     Color            = Brushes.Blue;
     ColorPush        = Brushes.Blue;
     Task.Run(async() =>
     {
         HeadBranch = await _gitManager.NameHeadBranch(_repositoryId);
     });
     Task.Run(async() =>
     {
         var result = await _gitManager.IsExistPullAsync(_repositoryId).ConfigureAwait(false);
         if (!result)
         {
             Color = Brushes.Red;
         }
     });
 }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                mvwForm.ActiveViewIndex     = 0;
                ViewState["_Sort"]          = "UserName";
                ViewState["_SortDirection"] = SortDirection.Ascending;

                ddlFindRoles.DataSource     = SecurityService.GetAllRoles();
                ddlFindRoles.DataValueField = "ID";
                ddlFindRoles.DataTextField  = "Name";
                ddlFindRoles.DataBind();

                ddlRole.DataSource     = SecurityService.GetAllRoles();
                ddlRole.DataValueField = "ID";
                ddlRole.DataTextField  = "Name";
                ddlRole.DataBind();
                ddlRole.Items.Insert(0, new DropDownListItem(String.Empty));
                ddlRole.SelectedIndex = 0;

                ddlHomeBranch.DataSource     = BranchService.GetActiveBranches();
                ddlHomeBranch.DataTextField  = "Name";
                ddlHomeBranch.DataValueField = "ID";
                ddlHomeBranch.DataBind();
                ddlHomeBranch.Items.Insert(0, new DropDownListItem(String.Empty));
            }
        }
Esempio n. 10
0
 private void FillDropDown()
 {
     ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
     ddlFindBranch.DataTextField  = "Name";
     ddlFindBranch.DataValueField = "ID";
     ddlFindBranch.DataBind();
 }
Esempio n. 11
0
 public BranchController(BranchService branchService, GroupService groupService, StudentService studentService, UserManager <ApplicationUser> userManager)
 {
     _branchService  = branchService;
     _groupService   = groupService;
     _studentService = studentService;
     _userManager    = userManager;
 }
Esempio n. 12
0
 public Response Update(Request <BranchUpdate> request)
 {
     try
     {
         ValidateBaseRequest(request);
         var branchService = BranchService.GetInstance();
         return(branchService.Update(request));
     }
     catch (RestaurantException ex)
     {
         return(new Response
         {
             ErrorCode = ex.ErrorCode
         });
     }
     catch (Exception e)
     {
         return(new Response
         {
             ErrorCode = new ErrorCode
             {
                 ErrorMessage = e.Message,
                 ErrorNumber = ErrorNumber.GeneralError
             }
         });
     }
 }
Esempio n. 13
0
 public PaymentController(BranchService branchService,
                          PaymentService paymentService, PaymentPeriodService periodService)
 {
     _branchService  = branchService;
     _paymentService = paymentService;
     _periodService  = periodService;
 }
Esempio n. 14
0
 public InventoryReport(HoldingService holdingService, IClassificationService classificationService, BranchService branchService)
 {
     this.holdingService        = holdingService;
     this.classificationService = classificationService;
     this.branchService         = branchService;
     congress = new LibraryOfCongress();
 }
 private void FillDropDown()
 {
     ddlFindBranch.DataSource     = BranchService.GetBranches();
     ddlFindBranch.DataTextField  = "Name";
     ddlFindBranch.DataValueField = "ID";
     ddlFindBranch.DataBind();
 }
Esempio n. 16
0
        public ActionResult Create()
        {
            // For Bind Company
            #region Company Bind
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();

            EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem();
            objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>();
            objEmpWorkHistoryItem.CompanyList.AddRange(objCompany);

            #endregion

            //For Bind Branch
            #region  Bind Branch
            List <BranchItem> objbranchitm     = new List <BranchItem>();
            BranchService     objbranchservice = new BranchService();
            objbranchitm = objbranchservice.GetAll();

            //objEmpItem = new EmployeeItem();
            objEmpWorkHistoryItem.BranchList = new List <BranchItem>();
            objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm);

            // for designation ddl
            clsMasterDataMethod objclsMasterDataMethod = new clsMasterDataMethod();
            objEmpWorkHistoryItem.DesignationList = objclsMasterDataMethod.GetAllDesignation();
            objEmpWorkHistoryItem.EmpId           = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            #endregion

            return(View(objEmpWorkHistoryItem));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                calFindFromDate.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                calFindToDate.SelectedDate   = DateTime.Today;

                ddlDocumentType.DataSource     = DocumentService.GetAllDocumentTypes();
                ddlDocumentType.DataTextField  = "Description";
                ddlDocumentType.DataValueField = "ID";
                ddlDocumentType.DataBind();
                ddlDocumentType.SelectedIndex = 0;

                ddlFindDocumentType.DataSource     = DocumentService.GetAllDocumentTypes();
                ddlFindDocumentType.DataTextField  = "Description";
                ddlFindDocumentType.DataValueField = "ID";
                ddlFindDocumentType.DataBind();
                ddlFindDocumentType.Items.Insert(0, new DropDownListItem(String.Empty, "0"));

                ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                ddlFindBranch.DataTextField  = "Name";
                ddlFindBranch.DataValueField = "ID";
                ddlFindBranch.DataBind();
                ddlFindBranch.SelectedIndex = 0;
                ddlFindBranch.Enabled       = false;
            }
        }
Esempio n. 18
0
        private void FillDropDown()
        {
            ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();

            ddlArea.DataSource     = AreaService.GetAll();
            ddlArea.DataTextField  = "Description";
            ddlArea.DataValueField = "ID";
            ddlArea.DataBind();
            ddlArea.Items.Insert(0, new DropDownListItem(String.Empty));

            ddlCreditCardType.DataSource     = CreditCardTypeService.GetAll();
            ddlCreditCardType.DataTextField  = "Description";
            ddlCreditCardType.DataValueField = "ID";
            ddlCreditCardType.DataBind();

            ddlOccupation.DataSource     = OccupationService.GetAll();
            ddlOccupation.DataTextField  = "Description";
            ddlOccupation.DataValueField = "ID";
            ddlOccupation.DataBind();
            ddlOccupation.Items.Insert(0, new DropDownListItem(String.Empty));

            ddlBank.DataSource     = BankService.GetActiveBanks();
            ddlBank.DataTextField  = "Name";
            ddlBank.DataValueField = "ID";
            ddlBank.DataBind();
            ddlBank.Items.Insert(0, String.Empty);

            DataBindingHelper.PopulateBillingTypes(BillingTypeService, ddlBillingType, false);
        }
Esempio n. 19
0
        private void OnSubordinatesClicked(object sender, EventArgs e)
        {
            UserServices  us = ServicesProvider.GetInstance().GetUserServices();
            BranchService bs = ServicesProvider.GetInstance().GetBranchService();

            User boss = _user;

            Debug.Assert(boss != null, "User is null");
            EditUserForm frm = new EditUserForm
            {
                Boss          = boss
                , AllUsers    = us.FindAllExcept(boss, false)
                , AllBranches = bs.FindAllNonDeleted()
            };

            if (DialogResult.OK != frm.ShowDialog())
            {
                return;
            }

            boss.ClearSubordinates();
            boss.AddSubordinates(frm.NewSubordinates());
            boss.ClearBranches();
            boss.AddBranches(frm.NewBranches());
            us.Save(boss);
            RefreshUser(boss);

            if (boss.Id != User.CurrentUser.Id)
            {
                return;
            }

//            ((MainView)MdiParent).ReloadAlerts();
        }
 public NotificationAppService(NotificationService _notificationService, ITransactionManager _transactionManager, IMapper _mapper, UserService _userService, BranchService _branchService)
 {
     mapper              = _mapper;
     branchService       = _branchService;
     notificationService = _notificationService;
     userService         = _userService;
     transactionManager  = _transactionManager;
 }
Esempio n. 21
0
        // /// <summary>
        // ///  获取所有部门信息不用异步
        // /// </summary>
        // /// <returns></returns>
        // public List<BranchDto> GetAll()
        // {
        //     List<BranchDto> list = _branchService.GetAll().Select(i => new BranchDto()
        //     {
        //         BranchId = i.Id,
        //         BranchName = i.BranchName
        //     }).ToList();
        //     return list;
        // }

        public async Task CrateData(string branchName)
        {
            using BranchService branchService = new BranchService();
            await branchService.CreateAsync(new Model.Employees.Branch()
            {
                BranchName = branchName
            });
        }
Esempio n. 22
0
 public CompanyViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     _companyService    = new CompanyService();
     _branchService     = new BranchService();
     _userService       = new UserService();
     _myCompany         = new Company();
 }
Esempio n. 23
0
 public LeadershipController()
 {
     _clusterService    = new ClusterService();
     _branchService     = new BranchService();
     _groupService      = new GroupService();
     _memberService     = new MemberService();
     _leadershipService = new LeadershipService();
 }
        public async Task <IActionResult> GetBranchesSimple()
        {
            var scope = AuthenticationService.GetScope(User);

            var branches = await BranchService.GetBranchesSimple(scope);

            return(Ok(branches));
        }
Esempio n. 25
0
        // private readonly IBranchService _branchService;
        // /// <summary>
        // ///  重写实现
        // /// </summary>
        // /// <param name="branchService"></param>
        // public BranchManage(IBranchService branchService)
        // {
        //     _branchService = branchService;
        // }

        public async Task <List <BranchDto> > GetAllBranch()
        {
            using BranchService branchService = new BranchService();
            return(await branchService.GetAllAsync().Select(i => new BranchDto()
            {
                BranchId = i.Id,
                BranchName = i.BranchName
            }).ToListAsync());
        }
Esempio n. 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         var branches = BranchService.GetActiveBranches(User.Identity.Name);
         PopulateBranches(branches);
         calDate.SelectedDate = DateTime.Today;
     }
 }
        private void FillDropDown(bool isAddNew = true)
        {
            ddlArea.DataSource     = AreaService.GetAll();
            ddlArea.DataTextField  = "Description";
            ddlArea.DataValueField = "ID";
            ddlArea.DataBind();
            ddlArea.Items.Insert(0, new ListItem(String.Empty, "0"));

            ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();


            ddlBillingType.DataSource     = BillingTypeService.GetActiveBillingTypes(isAddNew);
            ddlBillingType.DataTextField  = "Description";
            ddlBillingType.DataValueField = "ID";
            ddlBillingType.DataBind();
            ddlBillingType.Items.Insert(0, String.Empty);

            ddlPackage.DataSource     = PackageService.GetPackagesInBranch(Convert.ToInt32(ddlFindBranch.SelectedValue), isAddNew);
            ddlPackage.DataTextField  = "Name";
            ddlPackage.DataValueField = "ID";
            ddlPackage.DataBind();
            ddlPackage.Items.Insert(0, String.Empty);

            ddlOccupation.DataSource     = OccupationService.GetAll();
            ddlOccupation.DataValueField = "ID";
            ddlOccupation.DataTextField  = "Description";
            ddlOccupation.DataBind();
            ddlOccupation.Items.Insert(0, new DropDownListItem(String.Empty));

            ddlBillingBank.DataSource     = BankService.GetActiveBanks(isAddNew);
            ddlBillingBank.DataTextField  = "Name";
            ddlBillingBank.DataValueField = "ID";
            ddlBillingBank.DataBind();
            ddlBillingBank.Items.Insert(0, String.Empty);


            ddlCardExpiredMonth.DataSource     = CommonHelper.GetMonthNames();
            ddlCardExpiredMonth.DataTextField  = "Value";
            ddlCardExpiredMonth.DataValueField = "Key";
            ddlCardExpiredMonth.DataBind();
            ddlCardExpiredMonth.SelectedValue = DateTime.Today.Month.ToString(CultureInfo.InvariantCulture);

            ddlCardExpiredYear.DataSource = Enumerable.Range(2005, DateTime.Today.Year + 10 - 2005);
            ddlCardExpiredYear.DataBind();
            ddlCardExpiredYear.SelectedValue = DateTime.Today.Year.ToString();

            ddlMonthlyDuesItem.DataSource     = ItemService.GetMonthlyDuesItem();
            ddlMonthlyDuesItem.DataTextField  = "Description";
            ddlMonthlyDuesItem.DataValueField = "ID";
            ddlMonthlyDuesItem.DataBind();
            ddlMonthlyDuesItem.Items.Insert(0, String.Empty);

            DataBindingHelper.PopulateCreditCardTypes(CreditCardTypeService, ddlBillingCardType, true);
        }
        [UseCaseAuthorize("dir_view_branches", "dir_edit_users")] //If you can edit a user you need a list of branches
        public async Task <IActionResult> Index(string filters = null)
        {
            var scope = AuthenticationService.GetScope(User, User.IsSuperAdmin());

            var queryOptions = new BranchQueryOptions(scope, filters);
            var pagedItems   = await BranchService.GetBranches(queryOptions);

            return(Ok(pagedItems));
        }
        public void PersistentStorage()
        {
            service.Add("east");
            var secondService = new BranchService();

            Assert.That(secondService.BranchNames(), Is.EqualTo(new List <string> {
                "east"
            }));
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         mvwForm.SetActiveView(View1);
         var branches = BranchService.GetActiveBranches(User.Identity.Name);
         PopulateBranches(branches);
     }
 }
Esempio n. 31
0
        public static IEnumerable<SelectListItem> FillddlBranch()
        {
            var service = new BranchService();
            var branch = service.GetAll();
            var listitems = branch.Select(x =>

                new SelectListItem
                {
                    Text = x.BranchName,
                    Value = x.Id.ToString()
                });
            return listitems;
        }
Esempio n. 32
0
 public BranchesController()
 {
     Service = new BranchService();
 }