Example #1
0
        public ActionResult Create(MasterBranchDealviewModel model)
        {
            ValidateMasterBranchDealviewModel(model);
            TravelSession obj        = (TravelSession)Session["TravelPortalSessionInfo"];
            string        BranchCode = mDealProvider.GetBranchCodeByBranchId(obj.LoginTypeId);

            try
            {
                if (!ModelState.IsValid)
                {
                    model.CreatedBy        = obj.AppUserId;
                    model.BranchOfficeId   = obj.LoginTypeId;
                    model.BranchOfficeCode = BranchCode;

                    if (model.CopyDeal == true)
                    {
                        mDealProvider.CopyDealFromOneToAnotherForMobileBranch(model.DealName, model.DealMasterId, 3, model.BranchOfficeId, model.CreatedBy);
                    }
                    else
                    {
                        mDealProvider.AddDealMaster(model, 3);
                    }
                    return(RedirectToAction("Index", "BranchsDealSetup"));
                }
                else
                {
                    return(RedirectToAction("Index", "BranchsDealSetup"));
                }
            }
            catch
            {
                return(RedirectToAction("Index", "BranchsDealSetup"));
            }
        }
Example #2
0
        public ActionResult Create(MasterBranchDealviewModel model)
        {
            ValidateMasterBranchDealviewModel(model);
            TravelSession obj        = (TravelSession)Session["TravelPortalSessionInfo"];
            string        BranchCode = mDealProvider.GetBranchCodeByBranchId(obj.LoginTypeId);

            try
            {
                if (!ModelState.IsValid)
                {
                    model.CreatedBy        = obj.AppUserId;
                    model.BranchOfficeId   = obj.LoginTypeId;
                    model.BranchOfficeCode = BranchCode;
                    mDealProvider.AddDealMaster(model, 2);

                    return(RedirectToAction("Index", "HotelBranchDealSetup"));
                }
                else
                {
                    return(RedirectToAction("Index", "HotelBranchDealSetup"));
                }
            }
            catch
            {
                return(RedirectToAction("Index", "HotelBranchDealSetup"));
            }
        }