public bool DataBind(string contractTypeId)
        {
            int id;

            if (!int.TryParse(contractTypeId, out id))
            {
                return(SetViewUnable());
            }

            Model.ContractType theDataToBind = _IContractTypeFacade.GetContractTypeByPKID(id);
            if (theDataToBind != null)
            {
                _ItsView.ContractTypeID   = theDataToBind.ContractTypeID.ToString();
                _ItsView.ContractTypeName = theDataToBind.ContractTypeName;
                return(true);
            }
            return(SetViewUnable());
        }
 public void UpdateEvent()
 {
     //数据验证过程
     if (!new ContractTypeVaildater(_ItsView).Vaildate())
     {
         return;
     }
     //数据收集过程
     Model.ContractType theObject = _IContractTypeFacade.GetContractTypeByPKID(Convert.ToInt32(_ItsView.ContractTypeID));
     new ContractTypeDataCollector(_ItsView).CompleteTheObject(theObject);
     //执行事务过程
     try
     {
         _IContractTypeFacade.UpdateContractType(theObject);
         _ItsView.ActionSuccess = true;
     }
     catch (ApplicationException ae)
     {
         _ItsView.ResultMessage = ae.Message;
     }
 }
예제 #3
0
 public void UpdateContractEvent(object sender, EventArgs eventArgs)
 {
     if (Validate())
     {
         Employee     employee = _IEmployeeFacade.GetEmployeeByAccountID(_EmployeeId);
         ContractType type     = _IContractTypeFacade.GetContractTypeByPKID(Convert.ToInt32((_View.ContractTypeId)));
         Contract     contract = new Contract(_ContractId, type, _StartTime, _EndTime);
         contract.Attachment = _View.Attachment;
         contract.Remark     = _View.Remark;
         contract.EmployeeContractBookMark = _View.EmployeeContractBookMarkList;
         contract.ApplyAssessConditions    = _View.ConditionSource;
         try
         {
             _IEmployeeContractFacade.UpdateEmployeeContract(contract, employee);
             ToContractListPage(sender, null);
         }
         catch (Exception ex)
         {
             _View.ResultMessage = "<span class='fontred'>" + ex.Message + "</span>";
         }
     }
 }
예제 #4
0
        private byte[] DownLordEvent(int id)
        {
            ContractType contractType = _IContractTypeFacade.GetContractTypeByPKID(id);

            return(contractType.ContractTemplate);
        }