Esempio n. 1
0
        private bool GetFilter(ref string filter, ref ObservableCollection <object> paras, out int iYear, out int iMonthStart, out int iMonthEnd)
        {
            int.TryParse(nudYear.Value.ToString(), out iYear);
            int.TryParse(nudMonthStart.Value.ToString(), out iMonthStart);
            int.TryParse(nudMonthEnd.Value.ToString(), out iMonthEnd);

            OrgSelectEntity ose = lkOrg.DataContext as OrgSelectEntity;

            if (ose == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), "请选择机构后再进行查询");
                return(false);
            }
            else if (ose.IsMultipleType)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARNING"), "请选择相同类型的机构,如全是公司或全是人员");
                return(false);
            }
            else if (iMonthStart > iMonthEnd)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARNING"), "请输入正确的起止月份!");
                return(false);
            }


            ose.GetSqlValue(ref filter, ref paras);
            if (!string.IsNullOrWhiteSpace(strSearchSubjects))
            {
                GetSearchConditionBySubjectID(ref filter, ref paras);
            }
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// 导出流水
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnOutDayBook_Click(object sender, RoutedEventArgs e)
        {
            string filter = string.Empty;
            ObservableCollection <object> paras = new ObservableCollection <object>();
            string strOrgType = string.Empty;
            string strOrgID = string.Empty;
            int    iYear = 0, iMonthStart = 0, iMonthEnd = 0;
            var    isOK = GetFilter(ref filter, ref paras, out iYear, out iMonthStart, out iMonthEnd);

            if (!isOK)
            {
                return;
            }
            OrgSelectEntity ose = lkOrg.DataContext as OrgSelectEntity;

            if (ose.SelectedOrgType == OrgTreeItemTypes.Company || ose.SelectedValue.Count > 1)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARNING"), "导出流水,只支持选择一个部门或一个员工");
                return;
            }

            strOrgType = ose.SelectedOrgType.ToString();
            strOrgID   = ose.SelectedValue.FirstOrDefault().ObjectID;
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.DefaultExt  = ".xls";
            dialog.Filter      = "MS Excel Files|*.xls";
            dialog.FilterIndex = 1;

            bool?result = dialog.ShowDialog();

            if (result == true)
            {
                this.stream = dialog.OpenFile();
                loadbar.Start();

                if (dgQueryResult.Visibility == System.Windows.Visibility.Visible)
                {
                    clientFBA.OutFileDeptDayBookDataAsync(strOrgType, strOrgID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, iYear, iMonthStart, iMonthEnd, filter, paras, "order by UPDATEDATE");
                }

                if (dgPerQueryResult.Visibility == System.Windows.Visibility.Visible)
                {
                    clientFBA.OutFilePerDayBookDataAsync(strOrgType, strOrgID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, iYear, iMonthStart, iMonthEnd, filter, paras, "order by UPDATEDATE");
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 组织架构选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.MultiSelected   = true;
            lookup.SelectedObjType = OrgTreeItemTypes.All;
            lookup.ShowMessageForSelectOrganization();

            lookup.SelectedClick += (obj, ev) =>
            {
                List <ExtOrgObj> entList = lookup.SelectedObj as List <ExtOrgObj>;

                var se = new OrgSelectEntity(entList);

                lkOrg.DataContext       = se;
                lkOrg.DisplayMemberPath = "Text";
                var iTempOrgType = (int)se.SelectedOrgType;
                if (iTempOrgType == 0 || iTempOrgType == 1)
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }
                else if (iTempOrgType == 2 || iTempOrgType == 3)
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Collapsed;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    dgQueryResult.Visibility    = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }

                lkSubject.DataContext = null;
                if (dataPager.PageIndex != 1)
                {
                    dataPager.PageIndex = 1;
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Esempio n. 4
0
        /// <summary>
        /// 选择预算科目
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkSubject_FindClick(object sender, EventArgs e)
        {
            string filter = string.Empty;
            ObservableCollection <object> paras = new ObservableCollection <object>();
            string          strOrgType          = string.Empty;
            string          strOrgID            = string.Empty;
            OrgSelectEntity ose = lkOrg.DataContext as OrgSelectEntity;

            if (ose == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), "请选择机构后再进行查询");
                return;
            }
            else if (ose.IsMultipleType)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARNING"), "请选择相同类型的机构,如全是公司或全是人员");
                return;
            }

            ose.GetSqlValue(ref filter, ref paras);
            var intOrgType = (int)ose.SelectedOrgType;


            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("SUBJECTCODE", "SUBJECTCODE");
            cols.Add("SUBJECTNAME", "SUBJECTNAME");


            if (intOrgType == 3)
            {
                paras.Clear();
                List <string> filters = new List <string>();
                foreach (var item in ose.SelectedValue)
                {
                    var entEmp = item.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    var temp   = string.Format("(OWNERPOSTID=@{0})", paras.Count);
                    paras.Add(entEmp.OWNERPOSTID);
                    filters.Add(temp);
                }
                filter = "( " + string.Join(" or ", filters) + " )";
            }

            LookupForm lookup = new LookupForm(FBAEnumsBLLPrefixNames.Execution,
                                               typeof(T_FB_SUBJECT[]), cols, "T_FB_BUDGETCHECK", filter, paras);

            lookup.SelectedClick += (o, ev) =>
            {
                if (lookup.SelectedObj == null)
                {
                    return;
                }

                ObservableCollection <object> entList = lookup.SelectedObj as ObservableCollection <object>;

                StringBuilder strIDlist   = new StringBuilder();
                StringBuilder strNamelist = new StringBuilder();

                foreach (var obj in entList)
                {
                    T_FB_SUBJECT ent = obj as T_FB_SUBJECT;

                    strIDlist.Append(ent.SUBJECTID + ";");
                    strNamelist.Append(ent.SUBJECTNAME + ";");
                }

                strSearchSubjects        = strIDlist.ToString();
                lkSubject.TxtLookUp.Text = strNamelist.ToString();
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Esempio n. 5
0
        /// <summary>
        /// 组织架构选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkOrg_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();
            lookup.MultiSelected = true;
            lookup.SelectedObjType = OrgTreeItemTypes.All;
            lookup.ShowMessageForSelectOrganization();
            
            lookup.SelectedClick += (obj, ev) =>
            {
                List<ExtOrgObj> entList = lookup.SelectedObj as List<ExtOrgObj>;

                var se = new OrgSelectEntity(entList);
                
                lkOrg.DataContext = se;
                lkOrg.DisplayMemberPath = "Text";
                var iTempOrgType = (int)se.SelectedOrgType;
                if (iTempOrgType == 0 || iTempOrgType == 1)
                {
                    dgQueryResult.Visibility = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }
                else if (iTempOrgType == 2 || iTempOrgType == 3)
                {
                    dgQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Visible;

                }
                else
                {
                    dgQueryResult.Visibility = System.Windows.Visibility.Visible;
                    dgPerQueryResult.Visibility = System.Windows.Visibility.Collapsed;
                }

                lkSubject.DataContext = null;
                if (dataPager.PageIndex != 1)
                {
                    dataPager.PageIndex = 1;
                }
            };
            lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }