示例#1
0
        //public V_LicenseBorrow LicenseViewObj
        //{
        //    get { return licenseViewObj; }
        //    set
        //    {
        //        //this.DataContext = value;
        //        licenseViewObj = value;
        //    }
        //}

        #region 初始化
        public LicenseBorrowForm(Action action, string licenseID, string checkState)
        {
            InitializeComponent();
            this.action     = action;
            this.licenseID  = licenseID;
            this.checkState = checkState;
            InitEvent();
            switch (action)
            {
            case Action.Add:
                formTypeAction = FormTypes.New;
                break;

            case Action.Edit:
                formTypeAction = FormTypes.Edit;
                break;

            case Action.AUDIT:
                formTypeAction = FormTypes.Audit;
                break;

            case Action.Read:
                formTypeAction = FormTypes.Browse;
                break;

            case Action.ReSubmit:
                formTypeAction = FormTypes.Resubmit;
                break;
            }
            if (action != Action.Add)
            {
                if (action == Action.AUDIT)
                {
                    actionFlag = DataActionFlag.SubmitComplete;
                }
                client.GetLicenseBorrowListByIdAsync(licenseID);
            }
            if (checkState != ((int)CheckStates.UnSubmit).ToString() && checkState != ((int)CheckStates.UnApproved).ToString() && checkState != "5")   //只有未提交和未通过才能修改
            {
                if (action != Action.Add)
                {
                    SetReadOnly();
                }
            }
            else
            {
                if (action != Action.AUDIT && action != Action.Read)
                {
                    SetToolBar();
                }
                if (action == Action.Read)
                {
                    SetReadOnly();
                }
            }
        }
示例#2
0
 private void InitEvent()
 {
     client = new SmtOADocumentAdminClient();
     client.AddLicenseBorrowCompleted         += new EventHandler <AddLicenseBorrowCompletedEventArgs>(client_AddLicenseBorrowCompleted);
     client.GetLicenseBorrowListByIdCompleted += new EventHandler <GetLicenseBorrowListByIdCompletedEventArgs>(client_GetLicenseBorrowListByIdCompleted);
     client.UpdateLicenseBorrowCompleted      += new EventHandler <UpdateLicenseBorrowCompletedEventArgs>(client_UpdateLicenseBorrowCompleted);
     //audit.AuditCompleted += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(audit_AuditCompleted);
     //audit.Auditing += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(audit_Auditing);
     if (action == Action.Add)
     {
         //LicenseViewObj = new V_LicenseBorrow();
         //LicenseViewObj.licenseUser = new T_OA_LICENSEUSER();
         LicenseObj           = new T_OA_LICENSEUSER();
         licenseObj.STARTDATE = DateTime.Now;
         licenseObj.ENDDATE   = DateTime.Now.AddDays(7);
         //this.SumbitButton.Visibility = Visibility.Collapsed;
         //licenseObj = new T_OA_LICENSEUSER();
     }
     else
     {
         if (action == Action.AUDIT)
         {
             actionFlag = DataActionFlag.SubmitComplete;
         }
         client.GetLicenseBorrowListByIdAsync(licenseID);
     }
 }
示例#3
0
        private void InitEvent()
        {

            client = new SmtOADocumentAdminClient();
            client.AddLicenseBorrowCompleted += new EventHandler<AddLicenseBorrowCompletedEventArgs>(client_AddLicenseBorrowCompleted);
            client.GetLicenseBorrowListByIdCompleted += new EventHandler<GetLicenseBorrowListByIdCompletedEventArgs>(client_GetLicenseBorrowListByIdCompleted);
            client.UpdateLicenseBorrowCompleted += new EventHandler<UpdateLicenseBorrowCompletedEventArgs>(client_UpdateLicenseBorrowCompleted);
            //audit.AuditCompleted += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(audit_AuditCompleted);
            //audit.Auditing += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(audit_Auditing);
            if (action == Action.Add)
            {
                //LicenseViewObj = new V_LicenseBorrow();
                //LicenseViewObj.licenseUser = new T_OA_LICENSEUSER();
                LicenseObj = new T_OA_LICENSEUSER();
                licenseObj.STARTDATE = DateTime.Now;
                licenseObj.ENDDATE = DateTime.Now.AddDays(7);
                //this.SumbitButton.Visibility = Visibility.Collapsed;
                //licenseObj = new T_OA_LICENSEUSER();
            }
            else
            {
                if (action == Action.AUDIT)
                {
                    actionFlag = DataActionFlag.SubmitComplete;
                }
                client.GetLicenseBorrowListByIdAsync(licenseID);
            }
        }