Exemple #1
0
        public ActionResult Create(BranchDealViewModel model)
        {
            TravelSession       obj       = (TravelSession)Session["TravelPortalSessionInfo"];
            BranchDealViewModel viewModel = new BranchDealViewModel();
            BranchDealViewModel viewmodel = new BranchDealViewModel()
            {
                AirlineNameList = mDealProvider.GetAllAirlineNameList(),
                CurrencyList    = mDealProvider.GetCurrencyList(),
                DealMasterList  = mDealProvider.GetAllBranchDealMasterList(1, obj.LoginTypeId),
                DealMaserText   = mDealProvider.GetBranchDealMasterById(model.DealMasterId).BranchDealName,
            };

            if (ModelState.IsValid)
            {
                model.MakerId      = obj.AppUserId;
                model.MakerDate    = DateTime.UtcNow;
                model.isVerified   = true;
                model.VerifiedBy   = obj.AppUserId;
                model.VerifiedDate = DateTime.UtcNow;
                model.isDelete     = false;
                model.CreatedBy    = obj.AppUserId;

                int dealId = mDealProvider.Save_Air_BranchDeals(model);

                viewModel = mDealProvider.GetDealDetail(dealId);

                viewModel.AirlineNameList = mDealProvider.GetAllAirlineNameList();
                viewModel.CurrencyList    = mDealProvider.GetCurrencyList();
                viewModel.DealMasterList  = mDealProvider.GetAllBranchDealMasterList(1, obj.LoginTypeId);
                viewModel.CurrencyList    = mDealProvider.GetCurrencyList();

                if (Request != null && Request.IsAjaxRequest())
                {
                    return(PartialView("VUC_DealDetail", viewModel));
                }

                else
                {
                    return(View(viewModel));
                }
            }
            else
            {
                viewModel.AirlineNameList = mDealProvider.GetAllAirlineNameList();
                viewModel.CurrencyList    = mDealProvider.GetCurrencyList();
                viewModel.DealMasterList  = mDealProvider.GetAllBranchDealMasterList(1, obj.LoginTypeId);
                viewModel.CurrencyList    = mDealProvider.GetCurrencyList();
                //return PartialView("VUC_DealDetail", viewModel);
                return(View(viewModel));
            }
        }
        /////////////////


        ///////////////////////////Brnach Deal Setup Action Starts Here/////////////////////////////
        public ActionResult AjaxBranchDealDetail(int id, string source)
        {
            TravelSession       obj       = (TravelSession)Session["TravelPortalSessionInfo"];
            BranchDealViewModel viewModel = new BranchDealViewModel();

            viewModel = bDealProvider.GetDealDetail(id);
            viewModel.AirlineNameList = bDealProvider.GetAllAirlineNameList();
            viewModel.DealMasterList  = bDealProvider.GetAllBranchDealMasterList(1, obj.LoginTypeId);
            viewModel.CurrencyList    = bDealProvider.GetCurrencyList();

            if (Request != null && Request.IsAjaxRequest())
            {
                return(PartialView("VUC_BranchDealEdit", viewModel));
            }
            else
            {
                return(View(viewModel));
            }
        }
Exemple #3
0
        /////////////////

        public ActionResult DeleteBranchMasterDealForceFully(int id, string name)
        {
            BranchDealProvider bDealProvider = new BranchDealProvider();

            JsonResult          returnJsonData = new JsonResult();
            BranchDealViewModel viewmodel      = new BranchDealViewModel();

            viewmodel = bDealProvider.GetDealDetail(id);

            BranchDealViewModel masterviewmodel = new BranchDealViewModel();

            masterviewmodel = bDealProvider.GetMasterDealDetail(id);


            try
            {
                bDealProvider.Air_BranchDealChangesLogs(viewmodel);
                bDealProvider.Air_BranchDealMasterChangesLogs(masterviewmodel);

                bool          result = false;
                TravelSession obj    = (TravelSession)Session["TravelPortalSessionInfo"];
                viewmodel.DealMasterList = bDealProvider.GetAllBranchDealMasterList(2, obj.LoginTypeId);

                bDealProvider.Delete_Core_BranchDeals(id, obj.AppUserId);
                bDealProvider.Delete_Core_BranchDealMasters(id, obj.AppUserId);
                result = true;
                viewmodel.isVerified = result;
                returnJsonData.Data  = viewmodel;
                return(returnJsonData);
            }
            catch (Exception ex)
            {
                viewmodel.isVerified = false;
                returnJsonData.Data  = viewmodel;
            }
            return(returnJsonData);
        }