Ejemplo n.º 1
0
        public ActionResult DeleteMobileDistributorMasterDealForceFully(int id, string name)
        {
            JsonResult          returnJsonData = new JsonResult();
            BranchDealViewModel viewmodel      = new BranchDealViewModel();

            viewmodel = bDealProvider.GetMobileDistributorDealDetail(id);

            BranchDealViewModel masterviewmodel = new BranchDealViewModel();

            masterviewmodel = bDealProvider.GetDistributorMasterDealDetail(id);

            try
            {
                bDealProvider.Mobile_DistributorDealChangesLogs(viewmodel);

                bool          result = false;
                TravelSession obj    = (TravelSession)Session["TravelPortalSessionInfo"];

                bDealProvider.Delete_AgentClassDeals(id, obj.LoginTypeId);
                bDealProvider.Delete_Core_AgentsDeals(id, obj.LoginTypeId);
                bDealProvider.Delete_Mobile_DistributorDeals(id, obj.AppUserId);
                bDealProvider.Delete_Core_DistributorDealMasters(id, obj.AppUserId);

                viewmodel.DealMasterList = bDealProvider.GetAllDistributorDealMasterList(3, obj.LoginTypeId);

                result = true;

                viewmodel.isVerified = result;
                returnJsonData.Data  = viewmodel;
                return(returnJsonData);
            }
            catch (Exception ex)
            {
                viewmodel.isVerified = false;
                returnJsonData.Data  = viewmodel;
            }
            return(returnJsonData);
        }
        public ActionResult Delete(int id)
        {
            JsonResult returnJsonData = new JsonResult();

            BranchDealViewModel viewModel = new BranchDealViewModel();

            viewModel = mDealProvider.GetMobileDistributorDealDetail(id);

            try
            {
                mDealProvider.Mobile_DistributorDealChangesLogs(viewModel);

                bool          result = false;
                TravelSession obj    = (TravelSession)Session["TravelPortalSessionInfo"];
                result = mDealProvider.Delete_Mobile_DistributorDeals(id, obj.AppUserId);
                returnJsonData.Data = result;
            }
            catch (Exception ex)
            {
                returnJsonData.Data = "Sorry, unable to delete deal!";
            }
            return(returnJsonData);
        }