private void LoadBidData()
        {
            if (AppConfig.LstBid == null)
            {
                //加载标段
                DoWorkRun("加载标段数据中,请稍候...", "加载数据中",
                          () =>
                {
                    List <ProjectBid> result = new List <ProjectBid>();
                    result = new MeteringPaymentClient().GetIProjectBidService().GetList("WHERE StatId = 1");
                    return(result);
                },
                          (result, ex) =>
                {
                    if (ex == null)
                    {
                        AppConfig.LstBid = result as List <ProjectBid>;
                        tlBid.DataSource = AppConfig.LstBid;
                        tlBid.ExpandAll();
                    }
                });
            }
            else
            {
                tlBid.FocusedNodeChanged -= tlBid_FocusedNodeChanged;
                tlBid.DataSource          = AppConfig.LstBid;
                tlBid.FocusedNodeChanged += tlBid_FocusedNodeChanged;

                tlBid.RefreshDataSource();
                tlBid.ExpandAll();
                tlBid.FocusedNode = null;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ProjectNo"></param>
        public ChangeListViewModel(String ProjectNo, string ProjectName)
        {
            this.projectNo   = ProjectNo;
            this.projectName = ProjectName;
            MeteringPaymentClient client = new MeteringPaymentClient();

            projectBoqChangeService = client.GetIContractBoqChangeService();
            projectBoqService       = client.GetIContractBoqService();
            ChangedList             = new BindingList <ContractBoqChangeInfo>();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ChangeNo"></param>
        public ChangeDetailViewModel(BindingList <ContractBoqChangeInfo> ChangedList, String ProjectNo, string ProjectName = "")
        {
            this.projectNo   = ProjectNo;
            this.projectName = ProjectName;
            MeteringPaymentClient client = new MeteringPaymentClient();

            projectBoqChangeService = client.GetIContractBoqChangeService();
            projectBoqService       = client.GetIContractBoqService();
            this.ChangedList        = ChangedList;
            BoqChangeEx             = new ProjectBoqChangeEx();
            BoqChangeEx.ProjectNo   = projectNo;
        }
Ejemplo n.º 4
0
        private void GetMngrRole(string sLoginName)
        {
            LstGrpOrgs = new List <ProjectBid>();
            LstFGSOrgs = new List <ProjectBid>();
            LstProject = new List <ProjectInfo>();
            List <Manager> LstMngr = new List <Manager>();

            //LstMngr = CacheCollection.GetList<Manager>("ERP_Subpay.dbo.cmn_manager", " WHERE StatId=1 and LoginName='" + sLoginName + "'").ToList();
            LstMngr = new MeteringPaymentClient(AppConfig.SEndPoint, AppConfig.SLoginName, AppConfig.SPsw).GetIManagerService().GetList(String.Format(@" WHERE StatId=1 and LoginName='{0}' 
                                                                                                                                                         ORDER BY UserType ASC, ProjectName ASC", sLoginName));
            if (AppConfig.LstBid == null)
            {
                AppConfig.LstBid = new MeteringPaymentClient(AppConfig.SEndPoint, AppConfig.SLoginName, AppConfig.SPsw).GetIProjectBidService().GetList("WHERE StatId = 1");
            }
            List <Manager> LstGrpMngr = LstMngr.FindAll(m => m.UserType == 3).ToList();
            List <Manager> LstFGSMngr = LstMngr.FindAll(m => m.UserType == 2).ToList();
            List <Manager> LstXMBMngr = LstMngr.FindAll(m => m.UserType == 1).ToList();

            if (LstGrpMngr.Count > 0)
            {
                HasGrpMngrRole = true;
                LoginRole      = AppConfig.ManagerRole.GrpMngr;
                RoleCount++;
            }
            if (LstFGSMngr.Count > 0)
            {
                HasBaseMngrRole = true;
                LoginRole       = AppConfig.ManagerRole.FGSMngr;
                RoleCount++;
            }
            if (LstXMBMngr.Count > 0)
            {
                HasXMBMngrRole = true;
                LoginRole      = AppConfig.ManagerRole.XMBMngr;
                RoleCount++;
            }
            if (HasGrpMngrRole)
            {
                AppConfig.LstBid.ForEach(m =>
                {
                    LstGrpMngr.ForEach(n =>
                    {
                        if (m.BidNo == n.OrgNo)
                        {
                            LstGrpOrgs.Add(m);
                        }
                    });
                });
            }
            if (HasBaseMngrRole)
            {
                AppConfig.LstBid.ForEach(m =>
                {
                    LstFGSMngr.ForEach(n =>
                    {
                        if (m.BidNo == n.OrgNo)
                        {
                            LstFGSOrgs.Add(m);
                        }
                    });
                });
            }
            if (HasXMBMngrRole)
            {
                LstProject.Clear();
                LstXMBMngr.ForEach(m =>
                {
                    ProjectInfo project = new ProjectInfo();
                    project.ProjectNo   = m.ProjectNo;
                    project.ProjectName = m.ProjectName;
                    LstProject.Add(project);
                });
            }
        }
Ejemplo n.º 5
0
        private void bbi_import_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ////导入WBS
            //if (openFileDialog1.ShowDialog() == DialogResult.OK)
            //{
            //    List<WBSline> lines = ExcelHelper.Import(openFileDialog1.FileName);
            //    lines.ForEach(m =>
            //    {
            //        m.ProjectNo = viewModel.ProjectNo;
            //    });
            //    IWBSBoq wbsBoq = new MeteringPaymentClient().GetIWBSBoqService();
            //    wbsBoq.ImportWBS(viewModel.Boq.WbsNo, lines);
            //}


            //导入关联
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                List <WbsInfo> lines     = ExcelHelper.ImportWbsInfo(openFileDialog1.FileName);
                IWBSBoq        wbsBoq    = new MeteringPaymentClient().GetIWBSBoqService();
                List <WbsInfo> leafLines = new List <WbsInfo>();
                lines.ForEach(m =>
                {
                    GetLeafNodes(leafLines, m);
                });
                ContractBoqViewModel cVModel = new ContractBoqViewModel(viewModel.ProjectNo, viewModel.ProjectName);
                cVModel.Load();
                int k = 0;
                leafLines.ForEach(m =>
                {
                    m.Details.ForEach(n =>
                    {
                        ContractBoi boi = cVModel.Boq.BoiList.Find(x => x.IItemCoe == n.BoiCode /*&& x.ItemName == n.BoiName*/);
                        if (boi != null)
                        {
                            viewModel.InsertNodeRelation(m.WbsCode, boi.ItemNo, n.Qty);
                        }
                        k++;
                    });
                });
            }


            ////更新图纸桩号
            //if (openFileDialog1.ShowDialog() == DialogResult.OK)
            //{
            //    List<WbsInfo> lines = ExcelHelper.ImportWbsInfo(openFileDialog1.FileName);
            //    IWBSBoq wbsBoq = new MeteringPaymentClient().GetIWBSBoqService();
            //    List<WbsInfo> leafLines = new List<WbsInfo>();
            //    lines.ForEach(m =>
            //    {
            //        GetLeafNodes(leafLines, m);
            //    });
            //    List<WBSLineNode> nodeList = new List<WBSLineNode>(viewModel.NodeBindingSource);
            //    leafLines.ForEach(m =>
            //    {
            //        WBSLineNode line = nodeList.Find(n => n.WbsSysCode == m.WbsCode);
            //        line.DrawNo = m.DrawNo;
            //        line.StartStakesNo = m.StartNo;
            //        line.EndStakesNo = m.EndNo;
            //    });
            //}
        }