PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/EESoft/RetirementCenter/RetirementCenter/Forms/Qry/Qry00Frm.cs

https://github.com/EgyFalseX/Winform
C# | 91 lines | 69 code | 13 blank | 9 comment | 6 complexity | 34f7514de423aa17bb17837c8842779e MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel;
 4using System.Data;
 5using System.Drawing;
 6using System.Linq;
 7using System.Text;
 8using System.Threading;
 9using System.Windows.Forms;
10using DevExpress.Data.Linq;
11using DevExpress.XtraEditors;
12using DevExpress.XtraGrid.Views.Grid;
13using DevExpress.XtraSplashScreen;
14using System.Linq;
15using System.Runtime.Serialization;
16
17namespace RetirementCenter
18{
19    public partial class Qry00Frm : DevExpress.XtraEditors.XtraForm
20    {
21        DataSources.Linq.dsTeachersUnionViewsDataContext dsLinq = new DataSources.Linq.dsTeachersUnionViewsDataContext();
22        #region -   Functions   -
23        public Qry00Frm()
24        {
25            InitializeComponent();
26        }
27        #endregion
28        #region -   Event Handlers   -
29        private void QryTblAhteatyFrm_Load(object sender, EventArgs e)
30        {
31            //if (Program.UserInfo.IsAdmin)
32            //    LSMS.QueryableSource = dsLinq.vTBLMashats;
33            //else
34            //    LSMS.QueryableSource = from q in dsLinq.vTBLMashats where Program.UserInfo.Syndicates.Contains((int)q.SyndicateId) select q;
35            
36            
37            LSMSTBLMashats.QueryableSource = dsLinq.TBLMashats;
38
39            //gridViewTBLMashats.BestFitColumns();
40        }
41        private void btnPrintExport_Click(object sender, EventArgs e)
42        {
43            // Check whether the GridControl can be previewed.
44            if (!gridControlData.IsPrintingAvailable)
45            {
46                msgDlg.Show("The 'DevExpress.XtraPrinting' library is not found");
47                return;
48            }
49
50            // Open the Preview window.
51            gridControlData.ShowRibbonPrintPreview();
52        }
53
54        private void gridViewTBLMashats_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
55        {
56            return;
57            if (e.FocusedRowHandle < 0)
58                return;
59
60            GridView gv = (GridView)sender;
61            DataSources.Linq.TBLMashat member = (DataSources.Linq.TBLMashat)gv.GetRow(e.FocusedRowHandle);
62            LinqServerModeSource lsms = new LinqServerModeSource();
63            lsms.ElementType = typeof(DataSources.Linq.TBLWarasa);
64            lsms.KeyExpression = "PersonId";
65            lsms.QueryableSource = from q in dsLinq.TBLWarasas where q.MMashatId == member.MMashatId select q;
66            //gv.datasou
67        }
68
69        #endregion
70
71        private void gridViewTBLMashats_MasterRowGetChildList(object sender, MasterRowGetChildListEventArgs e)
72        {
73            GridView gv = (GridView)sender;
74            GridView gvdetail = (GridView)gv.GetDetailView(e.RowHandle, e.RelationIndex);
75            DataSources.Linq.TBLMashat member = (DataSources.Linq.TBLMashat)gv.GetRow(e.RowHandle);
76            LinqServerModeSource lsms = new LinqServerModeSource();
77            lsms.ElementType = typeof(DataSources.Linq.TBLWarasa);
78            lsms.KeyExpression = "PersonId";
79            lsms.QueryableSource = from q in dsLinq.TBLWarasas where q.MMashatId == member.MMashatId select q;
80            List<DataSources.Linq.TBLWarasa> query = (from q in dsLinq.TBLWarasas where q.MMashatId == member.MMashatId select q).ToList();
81            //e.ChildList = dsLinq.TBLWarasas.ToList().Where(x => x.MMashatId == member.MMashatId).ToList();
82            List<DataSources.Linq.TBLWarasa> xx = dsLinq.TBLWarasas.ToList().Where(x => x.MMashatId == member.MMashatId).ToList();
83            e.ChildList = xx;
84
85            DataTable dtl;
86
87        }
88        
89
90    }
91}