示例#1
0
        void client_GetPieEmployeeceInfoCompleted(object sender, GetPieEmployeeceInfoCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show("错误信息:" + e.Error.ToString());
            }
            else
            {
                if (e.Result != null)
                {
                    //等到员工数据
                    var employeeInfo = from p in e.Result select p;

                    List <PieEmployeece> employeeceList = new List <PieEmployeece>();
                    foreach (var item in employeeInfo)
                    {
                        PieEmployeece pieEmployeece = new PieEmployeece();
                        //婚姻状态
                        if (item.marriage == "" || item.marriage == null)
                        {
                            pieEmployeece.marriage = "离异";
                        }

                        else if (item.marriage == "1")
                        {
                            pieEmployeece.marriage = "已婚";
                        }

                        else if (item.marriage == "0")
                        {
                            pieEmployeece.marriage = "未婚";
                        }

                        //人数
                        pieEmployeece.CountEmployeece = item.CountEmployeece;
                        employeeceList.Add(pieEmployeece);
                    }

                    listPieEmployeece = employeeceList;

                    CreatePieChart();
                }
                else
                {
                    if (StrCompanyIDs == "")
                    {
                        MessageBox.Show("请选择公司!");
                    }
                    else
                    {
                        MessageBox.Show(nuYear.Value.ToString() + "年没有查询到数据!");
                        listPieEmployeece = null;
                    }
                }
            }
        }
示例#2
0
        void client_GetPieEmployeeceInfoCompleted(object sender, GetPieEmployeeceInfoCompletedEventArgs e)
        {
            if (e.Error!=null)
            {
                MessageBox.Show("错误信息:"+e.Error.ToString());
            }
            else
            {
                if (e.Result!=null )
                {
                    //等到员工数据
                    var employeeInfo = from p in e.Result select p;

                    List<PieEmployeece> employeeceList = new List<PieEmployeece>();
                    foreach (var item in employeeInfo)
                    {
                        PieEmployeece pieEmployeece = new PieEmployeece();
                        //婚姻状态
                        if (item.marriage =="" ||item.marriage==null)
                        {
                            pieEmployeece.marriage = "离异";
                        }

                        else if (item.marriage == "1")
                        {
                            pieEmployeece.marriage = "已婚";
                        }

                        else if (item.marriage == "0")
                        {
                            pieEmployeece.marriage = "未婚";
                        }
                        
                        //人数
                        pieEmployeece.CountEmployeece = item.CountEmployeece;
                        employeeceList.Add(pieEmployeece);
                    }

                    listPieEmployeece = employeeceList;

                    CreateCreatePieChart();
                }
                else
                {
                    if (StrCompanyIDs == "")
                    {
                        MessageBox.Show("请选择公司!");
                    }
                    else
                    {
                        MessageBox.Show(nuYear.Value.ToString() + "年没有查询到数据!");
                        listPieEmployeece = null;
                    }
                }
            }
        }