public ActionResult CreateCtaCobrar(clsPlanGrupoFormVM oPlanGrupoFormVM)
        {
            clsPlanGrupo    oPlanGrupo    = new clsPlanGrupo(clsAppInfo.Connection);
            clsPlanGrupoDet oPlanGrupoDet = new clsPlanGrupoDet(clsAppInfo.Connection);
            long            lngRowCount   = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    DataMove(oPlanGrupoFormVM, oPlanGrupo, false);
                    oPlanGrupo.BeginTransaction();

                    if (oPlanGrupo.Insert())
                    {
                        var oPlanGrupoDetVMList = (List <clsPlanGrupoDetVM>)Session[SessionKey];
                        oPlanGrupo.PlanGrupoId    = oPlanGrupo.Id;
                        oPlanGrupoDet.Transaction = oPlanGrupo.Transaction;

                        foreach (clsPlanGrupoDetVM oPlanGrupoDetVM in oPlanGrupoDetVMList)
                        {
                            DataMoveDet(oPlanGrupo, oPlanGrupoDetVM, oPlanGrupoDet, false);

                            if (oPlanGrupoDet.Insert())
                            {
                                lngRowCount += 1;
                            }
                        }

                        if (oPlanGrupoDetVMList.Count == lngRowCount)
                        {
                            oPlanGrupo.Commit();
                            Session[SessionKey] = null;
                            return(RedirectToAction("Index"));
                        }
                    }

                    oPlanGrupo.Rollback();
                }

                ViewBagLoad();
                return(View(oPlanGrupoFormVM));
            }

            catch (Exception exp)
            {
                oPlanGrupo.Rollback();

                ViewBagLoad();
                ViewBag.MessageErr = exp.Message;
                return(View(oPlanGrupoFormVM));
            }
        }