private void InitEvent()
 {
     BenefitsAdministration = new SmtOADocumentAdminClient();
     WelfareProvision = new V_WelfareProvision();
     BenefitsAdministration.GetWelfarePSelectRecordCompleted += new EventHandler<GetWelfarePSelectRecordCompletedEventArgs>(BenefitsAdministration_GetWelfarePSelectRecordCompleted);
     LoadData();
 }
        void btnReSubmit_Click(object sender, RoutedEventArgs e)
        {
            if (DaGr.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            V_WelfareProvision ent = DaGr.SelectedItems[0] as V_WelfareProvision;

            WelfareProvisionChildWindows AddWin = new WelfareProvisionChildWindows(FormTypes.Resubmit, ent.welfareProvision.WELFAREDISTRIBUTEMASTERID);
            EntityBrowser browser = new EntityBrowser(AddWin);

            browser.FormType         = FormTypes.Resubmit;
            browser.MinWidth         = 590;
            browser.MinHeight        = 490;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            WelfareProvisionID = new ObservableCollection <string>();
            if (DaGr.SelectedItems.Count > 0)
            {
                for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                {
                    V_WelfareProvision ent = DaGr.SelectedItems[i] as V_WelfareProvision;
                    if (ent.welfareProvision.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        WelfareProvisionID.Add((DaGr.SelectedItems[i] as V_WelfareProvision).welfareProvision.WELFAREDISTRIBUTEMASTERID);

                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            BenefitsAdministration.DeleteWelfareProvisionAsync(WelfareProvisionID);
                            LoadData();
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
 private void InitEvent()
 {
     BenefitsAdministration = new SmtOADocumentAdminClient();
     WelfareProvision       = new V_WelfareProvision();
     BenefitsAdministration.GetWelfarePSelectRecordCompleted += new EventHandler <GetWelfarePSelectRecordCompletedEventArgs>(BenefitsAdministration_GetWelfarePSelectRecordCompleted);
     LoadData();
 }
        void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            string strLeaveTypeSetID = string.Empty;

            if (DaGr.SelectedItems == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            V_WelfareProvision ent = DaGr.SelectedItems[0] as V_WelfareProvision;

            if (ent.welfareProvision.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString() || ent.welfareProvision.CHECKSTATE == ((int)CheckStates.UnApproved).ToString())
            {
                WelfareProvisionChildWindows AddWin = new WelfareProvisionChildWindows(FormTypes.Edit, ent.welfareProvision.WELFAREDISTRIBUTEMASTERID);
                EntityBrowser browser = new EntityBrowser(AddWin);
                browser.FormType         = FormTypes.Edit;
                browser.MinWidth         = 590;
                browser.MinHeight        = 490;
                browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYCANMODIFYTHEDATASUBMITTED"));
                return;
            }
        }
 private void browser_ReloadDataEvent()
 {
     if (welfarePaymentRecordsForm != null)
     {
         WelfareProvision = welfarePaymentRecordsForm.WelfareProvision;
         BenefitsAdministration.GetProvisionByIdAsync(WelfareProvision.welfareProvision.WELFAREDISTRIBUTEMASTERID);
     }
 }
        private void Save()
        {
            if (DaGr.SelectedItem != null)
            {
                V_WelfareProvision tmp = DaGr.SelectedItem as V_WelfareProvision;

                WelfareProvision = tmp;
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("PLEASESELECTPAYMENTRECORDS"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                return;
            }
            RefreshUI(RefreshedTypes.CloseAndReloadData);
        }
 public WelfarePaymentWithdrawalControl(FormTypes action, V_WelfareProvision AppObj)
 {
     InitializeComponent();
     this.actions     = action;
     WelfareProvision = AppObj;
     InitEvent();
     InitData();
     if (action == FormTypes.New)
     {
         BenefitsAdministration.GetProvisionByIdAsync(welfareInfoID);
         client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID); //获取当期用户信息
     }
     if (action == FormTypes.Audit || action == FormTypes.Browse)                   //审批,查看
     {
         ShieldedControl();
     }
 }
 public WelfarePaymentWithdrawalControl(FormTypes action, V_WelfareProvision AppObj)
 {
     InitializeComponent();
     this.actions = action;
     WelfareProvision = AppObj;
     InitEvent();
     InitData();
     if (action == FormTypes.New)
     {
         BenefitsAdministration.GetProvisionByIdAsync(welfareInfoID);
         client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);//获取当期用户信息
     }
     if (action == FormTypes.Audit || action == FormTypes.Browse)//审批,查看
     {
         ShieldedControl();
     }
 }
        void btnAudit_Click(object sender, RoutedEventArgs e)
        {
            string strLeaveTypeSetID = string.Empty;

            if (DaGr.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            V_WelfareProvision ent = DaGr.SelectedItems[0] as V_WelfareProvision;

            if (ent.welfareProvision.CHECKSTATE == ((int)CheckStates.Approving).ToString() ||
                ent.welfareProvision.CHECKSTATE == ((int)CheckStates.WaittingApproval).ToString() ||
                ent.welfareProvision.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
            {
                WelfareProvisionChildWindows AddWin = new WelfareProvisionChildWindows(FormTypes.Audit, ent.welfareProvision.WELFAREDISTRIBUTEMASTERID);
                EntityBrowser browser = new EntityBrowser(AddWin);
                browser.FormType         = FormTypes.Audit;
                browser.MinWidth         = 590;
                browser.MinHeight        = 490;
                browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTRECORDNOTOPERATEPLEASEAGAIN"));
                return;
            }
        }
        private void Save()
        {

            if (DaGr.SelectedItem != null)
            {
                V_WelfareProvision tmp = DaGr.SelectedItem as V_WelfareProvision;

                WelfareProvision = tmp;

            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("PLEASESELECTPAYMENTRECORDS"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                return;
            }
            RefreshUI(RefreshedTypes.CloseAndReloadData);
        }
 private void browser_ReloadDataEvent()
 {
     if (welfarePaymentRecordsForm != null)
     {
         WelfareProvision = welfarePaymentRecordsForm.WelfareProvision;
         BenefitsAdministration.GetProvisionByIdAsync(WelfareProvision.welfareProvision.WELFAREDISTRIBUTEMASTERID);
     }
 }