Exemplo n.º 1
0
        public ActionResult SearchPhoneBook(PhoneBookViewModel viewModel)
        {
            string sqlWhereString;
            string sqlAndString;

            if (viewModel.ColValue == "" || viewModel.ColValue.Length == 0)
            {
                sqlWhereString = " 1= 1";
            }
            else
            {
                sqlWhereString = "zza04 LIKE '%" + viewModel.ColValue + "%' ";
            }
            if (viewModel.Zza06 == "" || viewModel.Zza06 == null)
            {
                sqlAndString = "";
            }
            else
            {
                sqlAndString = " zza06 = '" + viewModel.Zza06 + "' ";
            }



            PhoneBookSQLConnector phoneBookSQLConnector = new PhoneBookSQLConnector();

            PhoneBookViewModel phoneBookViewModel = new PhoneBookViewModel();

            phoneBookViewModel.UserBasicDataList = phoneBookSQLConnector.GetUserBasicDataByCriteria(sqlWhereString, sqlAndString);
            phoneBookViewModel.SelectListItems   = phoneBookSQLConnector.getOfficeItem();

            TempData["phoneBookViewModel"] = phoneBookViewModel;

            return(Redirect("BackToPhoneBookSearch"));
        }
Exemplo n.º 2
0
        // GET: Phonebook
        public ActionResult PhoneBookSearch()
        {
            PhoneBookSQLConnector phoneBookSQLConnector = new PhoneBookSQLConnector();
            PhoneBookViewModel    phoneBookViewModel    = new PhoneBookViewModel();

            phoneBookViewModel.SelectListItems = phoneBookSQLConnector.getOfficeItem();

            return(View(phoneBookViewModel));
        }
Exemplo n.º 3
0
        public ActionResult HR(PhoneBookViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("PhoneBook/PhoneBookSearch"));
            }

            TempData["LastPostFormData"] = viewModel;
            string sqlWhereString;
            string sqlAndString;

            if (viewModel.ColValue == "" || viewModel.ColValue == null)
            {
                sqlWhereString = " zza06 LIKE '%" + viewModel.Zza06 + "910100' ";
            }
            else
            {
                sqlWhereString = "zza04 LIKE '%" + viewModel.ColValue + "%' ";
            }
            if (viewModel.Zza06 == "" || viewModel.Zza06 == null)
            {
                sqlAndString = "";
            }
            else
            {
                sqlAndString = " zza06 = '" + viewModel.Zza06 + "' ";
            }



            PhoneBookSQLConnector phoneBookSQLConnector = new PhoneBookSQLConnector();

            PhoneBookViewModel phoneBookViewModel = new PhoneBookViewModel();

            phoneBookViewModel.UserBasicDataList = phoneBookSQLConnector.GetUserBasicDataByCriteria(sqlWhereString, sqlAndString);
            phoneBookViewModel.SelectListItems   = phoneBookSQLConnector.getOfficeItem();

            TempData["phoneBookViewModel"] = phoneBookViewModel;

            return(Redirect("BackToPhoneBookSearch"));
        }
Exemplo n.º 4
0
        public ActionResult SearchPhoneBookButton(string Zza06)
        {
            string sqlAndString;

            if (Zza06 == "" || Zza06 == null)
            {
                sqlAndString = "";
            }
            else
            {
                sqlAndString = " zza06 = '" + Zza06 + "' ";
            }

            PhoneBookSQLConnector phoneBookSQLConnector = new PhoneBookSQLConnector();

            PhoneBookViewModel phoneBookViewModel = new PhoneBookViewModel();

            phoneBookViewModel.UserBasicDataList = phoneBookSQLConnector.GetUserBasicDataByCriteria(" 1=1 ", sqlAndString);
            phoneBookViewModel.SelectListItems   = phoneBookSQLConnector.getOfficeItem();

            TempData["phoneBookViewModel"] = phoneBookViewModel;

            return(Redirect("BackToPhoneBookSearch"));
        }