Ejemplo n.º 1
0
        public S_Evraklar_Result Evrak = new S_Evraklar_Result(); //Model.S_Evraklar_Result Evrak = new Model.S_Evraklar_Result();
        public void Datagetir()
        {
            //açınca ekran kitleniyor. incelemek lazım.
            //SplashScreenManager.ShowForm(this, typeof(BarduckCRM.Bekleyiniz), true, true);
            //SplashScreenManager.CloseForm();

            Evrak = data.S_Evraklar(DashboardID, true, 1).FirstOrDefault();   //Genel.PrmDb.S_Evraklar(DashboardID, true, Genel.DilID).FirstOrDefault();

            var DosyaYolu = data.S_AyarKarakter(2, 1).FirstOrDefault().Deger; //Genel.PrmDb.S_AyarKarakter(2, Genel.DilID).FirstOrDefault().Deger;

            DosyaYolu += Evrak.DosyaAdi + ".xml";
            byte[] bytearry = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            if (bytearry == null)
            {
                //Ayar.InfoMesajGoster(Genel.DilGetirMesaj(0), Ayar.MesajTipi.Hata, this);
                return;
            }
            Stream RepData = Genel.ByteArrayToStream(bytearry);

            DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();
            dasboard.BeginUpdateLayout();
            dasboard.LoadFromXml(RepData);

            dasboard.DataLoading += dasboard_DataLoading;
            dasboard.EndUpdateLayout();

            //    DataSet datasourcelist = Ayar.DsGetir(DashboardID, MusteriID, ProjeID, AktiviteID, Parametre4, Parametre5, Parametre6, Parametre7, Parametre8, Parametre9, Parametre10);
            ////    dasboard.DataSources.Clear();
            //    foreach (DataTable item in datasourcelist.Tables)
            //    {
            //        dasboard.AddDataSource(item.TableName, item);
            //        //if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
            //        //{
            //        //    dasboard.AddDataSource(item.TableName, item);
            //        //}
            //    }

            if (dasboard != null)
            {
                dashboardViewer1.Dashboard = dasboard;

                // dashboardViewer1.PopulateUnusedDataSources = true;
                // dashboardViewer1.ReloadData();
            }
        }
Ejemplo n.º 2
0
        private void btnTasarim_ItemClick(object sender, ItemClickEventArgs e)
        {
            //DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();

            //var DosyaYolu = data.S_AyarKarakter(2, 1).ToList().FirstOrDefault().Deger + "dash.xml";//gv.GetRowCellValue(iRowID, "DosyaAdi").ToString() + ".xml";
            //if (DosyaYolu == null)
            //    return;

            //byte[] bytearry = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            //if (bytearry != null)
            //{
            //    Stream RepData = Genel.ByteArrayToStream(bytearry);
            //    dasboard.LoadFromXml(RepData);
            //}



            ////DataSet datasourcelist = Ayar.DsGetir(iSelectedReportID, 1, 1, 1, 1, 1, 1, 1, 1, 1, 99, true);
            //////dasboard.DataSources.Clear();
            ////foreach (DataTable item in datasourcelist.Tables)
            ////{

            ////    if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
            ////    {
            ////        dasboard.AddDataSource(item.TableName, item);
            ////    }
            ////}
            ////dasboard.DataLoading += dasboard_DataLoading;

            //DashboardTasarim frm = new DashboardTasarim(dasboard);
            //frm.Show();

            #region Dashboard
            var    DosyaYolu = data.S_AyarKarakter(2, 1).FirstOrDefault().Deger + DosyaAdi + ".xml";
            byte[] bytearry  = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            if (bytearry != null)
            {
                Stream RepData = Genel.ByteArrayToStream(bytearry);
                DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();
                dasboard.LoadFromXml(RepData);

                DataSet datasourcelist = Genel.DsGetir(DashboardID, true);
                //dasboard.DataSources.Clear();
                foreach (DataTable item in datasourcelist.Tables)
                {
                    if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
                    {
                        dasboard.AddDataSource(item.TableName, item);
                    }
                }
                dasboard.DataLoading += dasboard_DataLoading;

                DashboardTasarim rep = new DashboardTasarim(dasboard);

                rep.ShowDialog();

                if (rep.SaveDashboard)
                {
                    MemoryStream stream = new MemoryStream();
                    rep.Dashboard.SaveToXml(stream);
                    stream.Position = 0;
                    byte[] RaporData = Genel.StreamToByteArray(stream);
                    data.IUD_Evraklar(4, DashboardID, RaporData, null, null, null, null, null, null, null, null, true, Genel.AktifKullaniciID);
                }
            }


            #endregion
        }