Esempio n. 1
0
 void client_GetChargeApplyDetailByMasterIDCompleted(object sender, GetChargeApplyDetailByMasterIDCompletedEventArgs e)
 {
     RefreshUI(RefreshedTypes.HideProgressBar);
     if (e.Result != null)
     {
         List<T_FB_CHARGEAPPLYDETAIL> chargeDetailList = e.Result.ToList();
         chaDtlobj = e.Result;
         //dgvChargeDetailList.ItemsSource = chargeDetailList;
         dgvChargeDetailList.ItemsSource = chaDtlobj;
         dgvChargeDetailList.Loaded += new RoutedEventHandler(dgvChargeDetailList_Loaded);
     }
 }
Esempio n. 2
0
        void client_GetChargeApplyMasterByIDCompleted(object sender, GetChargeApplyMasterByIDCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        ChargeMasterEntity = e.Result;
                        personclient.GetEmployeePostBriefByEmployeeIDAsync(ChargeMasterEntity.OWNERID);
                        if (!string.IsNullOrEmpty(ChargeMasterEntity.CHARGEAPPLYMASTERCODE.Trim()))
                        {
                            txtCode.Text = ChargeMasterEntity.CHARGEAPPLYMASTERCODE;
                        }
                        else
                        {
                            hideCode();
                        }


                        if (!string.IsNullOrEmpty(ChargeMasterEntity.BANK))
                        {
                            txtItemID.Text = ChargeMasterEntity.BANK;
                            txtItemCode.Text = ChargeMasterEntity.BANKACCOUT;
                            hypItemCode.Content = ChargeMasterEntity.BANKACCOUT;
                        }
                        else if (types == FormTypes.Audit || types == FormTypes.Browse)
                        {
                            itemA.Visibility = System.Windows.Visibility.Collapsed;
                            itemB.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        //txtPayInfo.Text = ChargeMasterEntity.PAYMENTINFO == null ? "" : ChargeMasterEntity.PAYMENTINFO;
                        txtRemark.Text = ChargeMasterEntity.REMARK == null ? "" : ChargeMasterEntity.REMARK;
                        txttotal.Text = ChargeMasterEntity.TOTALMONEY.ToString();
                        strOwnerCompanyID = ChargeMasterEntity.OWNERCOMPANYID;
                        strOwnerCompanyName = ChargeMasterEntity.OWNERCOMPANYNAME;
                        strOwnerDepartmentID = ChargeMasterEntity.OWNERDEPARTMENTID;
                        strOwnerDepartmentName = ChargeMasterEntity.OWNERDEPARTMENTNAME;
                        strOwnerPostID = ChargeMasterEntity.OWNERPOSTID;
                        strOwnerPostName = ChargeMasterEntity.OWNERPOSTNAME;
                        strOwnerID = ChargeMasterEntity.OWNERID;
                        strOwnerName = ChargeMasterEntity.OWNERNAME;
                        dgvRepayDetailList.Visibility = Visibility.Collapsed;
                        dgvRepayDetailList.IsEnabled = false;

                        SetPayInfo();
                        if (ChargeMasterEntity.PAYTYPE == 2)
                        {
                            txtTolRepayMon.Text = ChargeMasterEntity.REPAYMENT.ToString();
                            client.GetChargeApplyRepayDetailByMasterIDAsync(ChargeMasterEntity.CHARGEAPPLYMASTERID);
                        }
                        if (ChargeMasterEntity.T_FB_EXTENSIONALORDER != null)
                        {
                            tblExten.Visibility = Visibility.Visible;
                            hypExten.Visibility = Visibility.Visible;
                        }

                        if (Convert.ToString(e.UserState) == "Edit")
                        {
                            var arg = new GetChargeApplyDetailByMasterIDCompletedEventArgs(new object[]{ChargeMasterEntity.T_FB_CHARGEAPPLYDETAIL}, null, false, null);
                            client_GetChargeApplyDetailByMasterIDCompleted(null,arg);
                        }
                        else
                        {
                            ObservableCollection<object> chaMasterLst = new ObservableCollection<object>();
                            chaMasterLst.Add(ChargeMasterEntity.CHARGEAPPLYMASTERID);
                            client.GetChargeApplyDetailByMasterIDAsync(chaMasterLst);
                        }
                        if (ChargeMasterEntity.T_FB_EXTENSIONALORDER != null)
                        {
                            if (types == FormTypes.Resubmit)
                            {
                                EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>();
                                entBrowser.FormType = FormTypes.Browse;
                                RefreshUI(RefreshedTypes.ToolBar);
                                types = FormTypes.Browse;
                                SetForms();
                                MessageBox.Show( "请在出差报销模块中尝试重新提交!", "提示", MessageBoxButton.OK);
                            }
                            client.GetExtensionalOrderByIDAsync(ChargeMasterEntity.T_FB_EXTENSIONALORDER.EXTENSIONALORDERID);

                        }
                        // 删除多余的
                        ChargeMasterEntity.T_FB_CHARGEAPPLYDETAIL = null;
                        //查看时如果是兼职 在线公司 也显示
                        if (types == FormTypes.Browse)
                        {
                            var ents = from ent in SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts
                                       where ent.CompanyID == smtonlineID
                                       select ent;
                            if (ents.Count() > 0)
                            {
                                if (ChargeMasterEntity.OWNERCOMPANYID == smtonlineID)
                                {
                                    this.rbPayFromA.Visibility = Visibility.Visible;
                                    this.rbPayFromB.Visibility = Visibility.Visible;
                                }
                            }
                        }
                    }
                }
                
            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }