Esempio n. 1
0
        // GET: Admin/BranchInfo

        //DropDown List
        public void ViewBagList()
        {
            ViewBag.BranchStatus = (branchInfoBL.BranchStatusView().Select(x => new SelectListItem()
            {
                Value = x.BranchStatusID.ToString(), Text = x.BranchStatus
            }));
            ViewBag.BranchType   = (branchInfoBL.BranchTypeView().Select(x => new SelectListItem()
            {
                Value = x.BranchTypeID.ToString(), Text = x.BranchType
            }));
            ViewBag.CountryList  = addressBL.GetCountryList().Select(x => new SelectListItem()
            {
                Value = x.CountryID.ToString(), Text = x.CountryName, Selected = x.IsSelected
            });
        }
Esempio n. 2
0
 /// <summary>
 /// Viewbag List
 /// </summary>
 public void _ViewDetails()
 {
     ViewBag.TitleList = (registerBL.GetTitle().Select(x => new SelectListItem()
     {
         Value = x.TitleID.ToString(), Text = x.TitleName
     }));
     ViewBag.JobTitleList = (registerBL.GetJobTitle().Select(x => new SelectListItem()
     {
         Value = x.JobTitleID.ToString(), Text = x.JobTitleName
     }));
     //For Country List
     ViewBag.CountryList = addressBl.GetCountryList().Select(x => new SelectListItem()
     {
         Value    = x.CountryID.ToString(),
         Text     = x.CountryName,
         Selected = x.IsSelected
     });      //Gets Country List
 }
Esempio n. 3
0
 /// <summary>
 ///  For DropDown List
 /// </summary>
 public void _ViewBagList()
 {
     ViewBag.TimeFormatList = (cmyInfoBL.CommonTime().Select(x => new SelectListItem()
     {
         Value = x.TimeID.ToString(), Text = x.TimeFormat.ToString()
     }));
     ViewBag.DateFormatList = (cmyInfoBL.CommonDate().Select(x => new SelectListItem()
     {
         Value = x.DateFormatID.ToString(), Text = x.DateFormat
     }));
     ViewBag.CurrencyList   = (cmyInfoBL.CommonCurrency().Select(x => new SelectListItem()
     {
         Value = x.CurrencyID.ToString(), Text = x.Currency
     }));
     ViewBag.TimeZoneList   = (cmyInfoBL.GetTimeZone().Select(x => new SelectListItem()
     {
         Value = x.Id.ToString(), Text = x.DisplayName
     }));
     ViewBag.CountryList    = addressBL.GetCountryList().Select(x => new SelectListItem()
     {
         Value = x.CountryID.ToString(), Text = x.CountryName, Selected = x.IsSelected
     });
 }
Esempio n. 4
0
        private AddressBL addressBl = new AddressBL();  //Gets all methods from AddressBL

        #region Employee

        /// <summary>
        /// Sets ViewBags values
        /// </summary>
        private void SetViewBag()
        {
            //Employee related dropdowns
            ViewBag.Branch = (bl.GetBranch().Select(x => new SelectListItem()
            {
                Value = x.BranchID.ToString(),
                Text = x.BranchName
            }).OrderBy(branch => branch.Text));    //Gets Branch List in the alphabet order

            ViewBag.Title = (bl.GetTitle().Select(x => new SelectListItem()
            {
                Value = x.TitleID.ToString(),
                Text = x.TitleName
            }).OrderBy(title => title.Text));     //Gets Title List in the alphabet order

            ViewBag.MaritalStatus = (bl.GetMaritalStatusList().Select(x => new SelectListItem()
            {
                Value = x.MaritalStatusID.ToString(),
                Text = x.MaritalStatusName
            }).OrderBy(mStatus => mStatus.Text));     //Gets Marital Status List in the alphabet order

            ViewBag.NationalityStatus = (bl.GetNationalityList().Select(x => new SelectListItem()
            {
                Value = x.NationalityID.ToString(),
                Text = x.NationalityName
            }).OrderBy(nStatus => nStatus.Text));     //Gets Nationality Status List in the alphabet order

            ViewBag.EmployeeType = (bl.GetEmployeeTypeList().Select(x => new SelectListItem()
            {
                Value = x.EmployeeTypeID.ToString(),
                Text = x.EmployeeTypeName
            }).OrderBy(empType => empType.Text));     //Gets Employee Type List in the alphabet order

            ViewBag.EthnicGroup = (bl.GetEthnicGroupList().Select(x => new SelectListItem()
            {
                Value = x.EthnicGroupID.ToString(),
                Text = x.EthnicGroupName
            }).OrderBy(eGroup => eGroup.Text));     //Gets Ethnic Group List in the alphabet order

            ViewBag.ImmigrationStatus = (bl.GetImmigrationStatusList().Select(x => new SelectListItem()
            {
                Value = x.ImmigrationStatusID.ToString(),
                Text = x.ImmigrationName
            }).OrderBy(immiStatus => immiStatus.Text));     //Gets Immigration Status List in the alphabet order

            ViewBag.TimeSheetFrequency = (bl.GetTimeSheetFrequencyList().Select(x => new SelectListItem()
            {
                Value = x.TimeSheetFrequencyID.ToString(),
                Text = x.TimeSheetFrequencyName
            }).OrderBy(timeSheet => timeSheet.Text));     //Gets Timesheet Frequency List in the alphabet order

            //Country related dropdowns
            ViewBag.CountryList = addressBl.GetCountryList().Select(x => new SelectListItem()
            {
                Value    = x.CountryID.ToString(),
                Text     = x.CountryName,
                Selected = x.IsSelected
            });      //Gets Country List

            //Payment related dropdowns
            ViewBag.PaymentType = (bl.GetPaymentType().Select(x => new SelectListItem()
            {
                Value = x.PaymentTypeID.ToString(),
                Text = x.PaymentName
            }).OrderBy(payType => payType.Text));                                                 //Gets PaymentType List in the alphabet order

            ViewBag.ListOfBranch = new MultiSelectList(bl.GetBranch(), "BranchID", "BranchName"); //Gets Branch List for multi Branch selection
        }