public ActionResult _Edit(CustReportMaster CustReport)
 {
     if (ModelState.IsValid)
     {
         this.genericMgr.UpdateWithTrim(CustReport);
         SaveSuccessMessage(Resources.Report.CustReport.CustReport_Updated);
     }
     this.custmgr.UpdateCustReport(CustReport);
     systemMgr.ResetCache();
     return PartialView(CustReport);
 }
        public void UpdateCustReport(CustReportMaster custReport)
        {
            //delete top (1) from ACC_Permission output deleted.Code, deleted.Desc1, deleted.Category, deleted.Sequence into #jjjj  where Sequence =-1
            //select top 1000 * from ACC_Permission where  Id =9584
            //select top 1000 * from ACC_RolePermission where PermissionId =9584 RolePermission
            //select top 1000 * from ACC_UserPermission where PermissionId =9584 UserPermission
            //select top 1000 * from ACC_PermissionGroupPermission where PermissionId =9584 PermissionGroupPermission
            Permission accPermission = genericMgr.FindAll<Permission>("from Permission where Code = ?", custReport.Code).FirstOrDefault();
            accPermission.Description = "报表管理-信息-" + custReport.Name;
            if (custReport.IsActive && accPermission != null)
            {
                accPermission.Sequence = custReport.Seq;
            }
            else
            {
                accPermission.Sequence = -1;
            }
            genericMgr.UpdateWithTrim(accPermission);

        }
        public ActionResult New(CustReportMaster CustReport)
        {
            if (ModelState.IsValid)
            {
                if (this.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { CustReport.Code })[0] > 0)
                {
                    SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, CustReport.Code);
                }
                else
                {
                    CustReport.IsActive = true;
                    this.genericMgr.CreateWithTrim(CustReport);
                    this.custmgr.AddNewCustReport(CustReport.Code);
                    systemMgr.ResetCache();
                    SaveSuccessMessage(Resources.Report.CustReport.CustReport_Added);
                    return RedirectToAction("Edit/" + CustReport.Code);
                }
            }

            return View(CustReport);
        }