private static bool CanSubmitToLeader(PunishmentDossier dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.待审核) &&
            dossier.State.Equals(DossierStateConst.法规科审核);
 }
 private static bool IsEditAble(PunishmentDossier contract)
 {
     if (contract == null) return false;
     return string.IsNullOrEmpty(contract.State) || contract.State.Equals(DossierStateConst.整改案卷);
 }
 private static bool CanSubmitReport(PunishmentDossier dossier)
 {
     return dossier != null && dossier.State.Equals(DossierStateConst.整改案卷);
 }
 private static bool CanSubmitToLeader(PunishmentDossier dossier)
 {
     return dossier != null && string.IsNullOrEmpty(dossier.State);
 }
 private static bool CanSubmitFinal(PunishmentDossier dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.已审核) && dossier.State.Equals(DossierStateConst.审核整改报告);
 }
 private static bool CanBack(PunishmentDossier dossier)
 {
     if (dossier == null) return false;
     return dossier.State.Equals(DossierStateConst.接收反馈意见);
 }
 private static bool CanApprove(PunishmentDossier dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.待审核) &&
            (dossier.State.Equals(DossierStateConst.专卖科审核) || dossier.State.Equals(DossierStateConst.审核整改报告));
 }
        public ActionResult Create(FormCollection collection)
        {
            var model = new PunishmentDossier();
            TryUpdateModel(model, collection.ToValueProvider());
            if (!ModelState.IsValid)
            {
                return View(model);
            }
            using (var session = new SessionFactory().OpenSession())
            {
                session.BeginTransaction();
                model.CreatedAt = DateTime.Now;
                model.CreatedBy = CurrentAccountNo;
                model.Time = DateTime.Now;
                model.Undertaker = CurrentAccountNo.GetName();
                model.State = "";
                model.ApproveState = "";
                ViewData.Model = model;
                if (session.Create(model))
                {
                    session.Commit();
                    FlashSuccess("创建记录成功!");
                    return Close();
                }
                session.Rollback();
                FlashFailure("创建记录失败!");
                return View();

            }
        }
 private static bool CanBack(PunishmentDossier dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.已审核) &&
            dossier.State.Equals(DossierStateConst.分管领导审批);
 }