private static bool CanSubmitToLawDept(Record dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.已审核) && dossier.State.Equals(RecordStateConst.承办部门审核);
 }
 private static bool CanSubmitToLeader(Record dossier)
 {
     return dossier != null && string.IsNullOrEmpty(dossier.State);
 }
 private static bool CanBack(Record dossier)
 {
     if (dossier == null) return false;
     return dossier.State.Equals(RecordStateConst.接收反馈意见);
 }
 private static bool CanSubmitFinal(Record dossier)
 {
     return dossier != null && dossier.State.Equals(RecordStateConst.修改制度);
 }
 private static bool CanApprove(Record dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.待审核) &&
            dossier.State.Equals(RecordStateConst.承办部门审核);
 }
 public ActionResult Create(FormCollection collection)
 {
     var model = new Record();
     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();
         var dept = new Criteria<Department>(session)
             .AndIn<User>(m => m.Id, n => n.DepartmentId, m => m.Code.Equals(CurrentAccountNo)).Load();
         model.DeptId = dept != null ? dept.Id : 0;
         model.Dept = dept != null ? dept.Name : null;
         model.State = "";
         model.ApproveState = "";
         ViewData.Model = model;
         if (session.Create(model))
         {
             session.Commit();
             FlashSuccess("创建记录成功!");
             return Close();
         }
         session.Rollback();
         FlashFailure("创建记录失败!");
         return Close();
     }
 }
 private static bool IsEditAble(Record contract)
 {
     if (contract == null) return false;
     return string.IsNullOrEmpty(contract.State) || contract.State.Equals(RecordStateConst.修改制度);
 }
 private static bool CanSubmitToLeader(Record dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.待审核) &&
            dossier.State.Equals(RecordStateConst.法规科审核);
 }
 private static bool CanBack(Record dossier)
 {
     if (dossier == null) return false;
     return dossier.ApproveState.Equals(ApproveStateConst.已审核) && dossier.State.Equals(RecordStateConst.法规科审核);
 }