Esempio n. 1
0
        public override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                PageOperations PageOps = new PageOperations();
                //List<HocaBilgiObj> lstScreenInfoObj = PageOps.RunQueryForPage<HocaBilgiObj>(DbCommandList.GET_HOCA_BILGI, null, null);
                List <HocaBilgiObj> lstScreenInfoObj = null;

                if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <HocaBilgiObj>(DbCommandList.GET_HOCA_BILGI,
                                                                              new string[] { "P_HOCA_ID" },
                                                                              new object[] { ksfSI.HocaGuid });
                }
                else
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <HocaBilgiObj>(DbCommandList.GET_HOCA_BILGI, null, null);
                }

                tblRepeater.DataSource = lstScreenInfoObj;
                tblRepeater.DataBind();
            }
            catch (Exception ex)
            {
                standardErr = "İşlem gerçekleştirilirken bir hata oluştu.";
                RaisePopUp(ex.Message, ResultStatus.Error);
            }
        }
Esempio n. 2
0
        public override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                deleteUrl = pageName + "/DeleteCurrentRow";
                PageOperations         PageOps          = new PageOperations();
                List <PageOgrBilgiObj> lstScreenInfoObj = null;

                if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <PageOgrBilgiObj>(DbCommandList.GET_PAGE_OGR_BILGI,
                                                                                 new string[] { "P_HOCA_ID" },
                                                                                 new object[] { ksfSI.HocaGuid });
                }
                else if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.OGRENCI.ToString() || ksfSI.RoleName.ToUpper() == RoleNames.VELI.ToString())
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <PageOgrBilgiObj>(DbCommandList.GET_PAGE_OGR_BILGI,
                                                                                 new string[] { "P_OGR_ID" },
                                                                                 new object[] { ksfSI.OgrenciGuid });
                }
                else//Tüm öğrencileri getirir.
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <PageOgrBilgiObj>(DbCommandList.GET_PAGE_OGR_BILGI, null, null);
                }

                tblRepeater.DataSource = lstScreenInfoObj;
                tblRepeater.DataBind();
            }
            catch (Exception ex)
            {
                standardErr = "İşlem gerçekleştirilirken bir hata oluştu.";
                RaisePopUp(ex.Message, ResultStatus.Error);
            }
        }
Esempio n. 3
0
        public override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                PageOperations PageOps = new PageOperations();

                List <TestCozmeDurumuObj> lstScreenInfoObj = null;
                string[] paramNames  = null;
                object[] paramValues = null;
                if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.OGRENCI.ToString() || ksfSI.RoleName.ToUpper() == RoleNames.VELI.ToString())
                {
                    paramNames       = new string[] { "P_OGR_ID" };
                    paramValues      = new object[] { ksfSI.OgrenciGuid };
                    lstScreenInfoObj = PageOps.RunQueryForPage <TestCozmeDurumuObj>(DbCommandList.GET_OGR_TEST_REL, paramNames, paramValues);
                }
                else//Hem Hocaların hem de öğrencilerin müfredat bilgilerini getirir.
                {
                    lstScreenInfoObj = PageOps.RunQueryForPage <TestCozmeDurumuObj>(DbCommandList.GET_OGR_TEST_REL, null, null);
                }



                tblRepeater.DataSource = lstScreenInfoObj;
                tblRepeater.DataBind();
            }
            catch (Exception ex)
            {
                standardErr = "İşlem gerçekleştirilirken bir hata oluştu.";
                RaisePopUp(ex.Message, ResultStatus.Error);
            }
        }
Esempio n. 4
0
        public override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionInfo sessionInfo = (SessionInfo)Session["KsfSessionInfo"];

                deleteUrl = pageName + "/DeleteCurrentRow";
                PageOperations      PageOps          = new PageOperations();
                List <UserTableObj> lstScreenInfoObj = PageOps.RunQueryForPage <UserTableObj>(DbCommandList.GET_USER_INFO, null, null);

                //Eğer bu oturumdaki kullanıcı adminse ve Owner rolüne sahipse : bu user'ın guid bilgileri boş set edilsin.
                if (sessionInfo.IsAdmin == 1 && sessionInfo.RoleGuid == 2)
                {
                    //List<UserTableObj> lstCantDeleted = (List<UserTableObj>)lstScreenInfoObj.Select(x => x.ROLE_GUID == 2 && x.IS_ADMIN == "Evet");
                }

                //lstScreenInfoObj.Where(x=>x.ROLE_GUID==2 && sessionInfo.IsAdmin && sessionInfo.RoleGuid==2?)



                tblRepeater.DataSource = lstScreenInfoObj;
                tblRepeater.DataBind();
            }
            catch (Exception ex)
            {
                standardErr = "İşlem gerçekleştirilirken bir hata oluştu.";
                RaisePopUp(ex.Message, ResultStatus.Error);
            }
        }
Esempio n. 5
0
        public override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                PageOperations      PageOps          = new PageOperations();
                List <TestBilgiObj> lstScreenInfoObj = PageOps.RunQueryForPage <TestBilgiObj>(DbCommandList.GET_TEST_BILGI, null, null);

                tblRepeater.DataSource = lstScreenInfoObj;
                tblRepeater.DataBind();
            }
            catch (Exception ex)
            {
                standardErr = "İşlem gerçekleştirilirken bir hata oluştu.";
                RaisePopUp(ex.Message, ResultStatus.Error);
            }
        }
Esempio n. 6
0
        private bool LoadParameters()
        {
            #region FillDersAdı
            PageOperations   PageOps       = new PageOperations();
            List <NameValue> lstDataSource = new List <NameValue>();
            lstDersBilgi = PageOps.RunQueryForPage <DERS_BILGI>(DbCommandList.GET_DERS_BILGI, null, null);

            lstDataSource = new List <NameValue>();

            List <DERS_BILGI> lstCurrentDersBilgiObj = lstDersBilgi.Where <DERS_BILGI>(x => x.SINIF.ToString() == slcSinif.Value).ToList();


            foreach (var item in lstCurrentDersBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.DERS_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcDersAdi.DataSource     = lstDataSource.ToArray();
                slcDersAdi.DataTextField  = "Name";
                slcDersAdi.DataValueField = "Value";
                slcDersAdi.DataBind();
            }
            else
            {
                slcDersAdi.DataSource = null;
                slcDersAdi.DataBind();
            }
            #endregion

            return(true);
        }
Esempio n. 7
0
        private bool LoadParameters()
        {
            #region FillMahalleBilgisi
            PageOperations    PageOps       = new PageOperations();
            List <NameValue>  lstDataSource = new List <NameValue>();
            List <BOLGE_INFO> lstBolgeInfo  = PageOps.RunQueryForPage <BOLGE_INFO>(DbCommandList.GET_BOLGE_INFO, null, null);

            lstDataSource.Clear();
            lstDataSource = new List <NameValue>();

            foreach (var item in lstBolgeInfo)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.BOLGE_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcMahalle.DataSource     = lstDataSource.ToArray();
                slcMahalle.DataTextField  = "Name";
                slcMahalle.DataValueField = "Value";
                slcMahalle.DataBind();
            }
            else
            {
                slcMahalle.DataSource = null;
                slcMahalle.DataBind();
            }
            #endregion


            return(true);
        }
        private bool LoadParameters()
        {
            #region FillHocaBilgisi
            PageOperations      PageOps          = new PageOperations();
            List <HocaBilgiObj> lstScreenInfoObj = PageOps.RunQueryForPage <HocaBilgiObj>(DbCommandList.GET_HOCA_BILGI, null, null);
            List <NameValue>    lstDataSource    = new List <NameValue>();

            //Login olan kullanıcı Hoca rolündeyse sadece o hocanın bilgisi gelir.
            if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
            {
                lstScreenInfoObj = lstScreenInfoObj.Where(x => x.HOCA_GUID == ksfSI.HocaGuid).ToList();
            }

            foreach (var item in lstScreenInfoObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HOCA_ADI + " " + item.HOCA_SOYADI + " - " + item.SINIF + ". sınıf",
                    Value = item.HOCA_GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHocaBilgi.DataSource     = lstDataSource.ToArray();
                slcHocaBilgi.DataTextField  = "Name";
                slcHocaBilgi.DataValueField = "Value";
                slcHocaBilgi.DataBind();
            }
            else
            {
                slcHocaBilgi.DataSource = null;
                slcHocaBilgi.DataBind();
            }
            #endregion

            #region FillMahalleBilgisi
            List <BOLGE_INFO> lstBolgeInfo = PageOps.RunQueryForPage <BOLGE_INFO>(DbCommandList.GET_BOLGE_INFO, null, null);

            lstDataSource.Clear();
            lstDataSource = new List <NameValue>();

            foreach (var item in lstBolgeInfo)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.BOLGE_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcMahalle.DataSource     = lstDataSource.ToArray();
                slcMahalle.DataTextField  = "Name";
                slcMahalle.DataValueField = "Value";
                slcMahalle.DataBind();
            }
            else
            {
                slcMahalle.DataSource = null;
                slcMahalle.DataBind();
            }
            #endregion


            return(true);
        }
Esempio n. 9
0
        private bool LoadParameters()
        {
            #region Fill User Role Info
            PageOperations   PageOps          = new PageOperations();
            List <USER_ROLE> lstScreenInfoObj = PageOps.RunQueryForPage <USER_ROLE>(DbCommandList.PRM_USER_ROLES, null, null);
            List <NameValue> lstDataSource    = new List <NameValue>();

            foreach (var item in lstScreenInfoObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.ROLE_NAME,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcRole.DataSource     = lstDataSource.ToArray();
                slcRole.DataTextField  = "Name";
                slcRole.DataValueField = "Value";
                slcRole.DataBind();
            }
            else
            {
                slcRole.DataSource = null;
                slcRole.DataBind();
            }
            #endregion

            #region Fill Mahalle Bilgisi
            List <BOLGE_INFO> lstBolgeInfo = PageOps.RunQueryForPage <BOLGE_INFO>(DbCommandList.GET_BOLGE_INFO, null, null);

            lstDataSource.Clear();
            lstDataSource = new List <NameValue>();

            foreach (var item in lstBolgeInfo)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.BOLGE_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcMahalle.DataSource     = lstDataSource.ToArray();
                slcMahalle.DataTextField  = "Name";
                slcMahalle.DataValueField = "Value";
                slcMahalle.DataBind();
            }
            else
            {
                slcMahalle.DataSource = null;
                slcMahalle.DataBind();
            }
            #endregion

            #region Fill Ogrenci
            PageOps     = new PageOperations();
            lstOgrBilgi = PageOps.RunQueryForPage <OGR_BILGI>(DbCommandList.PRM_OGR, null, null);
            #endregion

            #region Fill Hoca
            lstDataSource = null;
            PageOps       = new PageOperations();
            lstHocaBilgi  = PageOps.RunQueryForPage <HOCA_BILGI>(DbCommandList.PRM_HOCA, null, null);
            #endregion

            ViewState.Clear();
            ViewState.Add("lstOgrBilgi", lstOgrBilgi);

            return(true);
        }
Esempio n. 10
0
        private bool LoadParameters()
        {
            #region Fill Hafta
            PageOperations    PageOps       = new PageOperations();
            List <NameValue>  lstDataSource = new List <NameValue>();
            List <HOCA_BILGI> lstHocaBilgi  = PageOps.RunQueryForPage <HOCA_BILGI>(DbCommandList.PRM_HOCA, null, null);
            lstDataSource = new List <NameValue>();

            List <HAFTA_BILGI> lstHaftaBilgi = PageOps.RunQueryForPage <HAFTA_BILGI>(DbCommandList.GET_HAFTA_BILGI, null, null);
            lstDataSource = new List <NameValue>();
            foreach (var item in lstHaftaBilgi)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HAFTA_ADI + " : " + item.TARIH,
                    Value = item.HAFTA_ID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHafta.DataSource     = lstDataSource.ToArray();
                slcHafta.DataTextField  = "Name";
                slcHafta.DataValueField = "Value";
                slcHafta.DataBind();
            }
            else
            {
                slcHafta.DataSource = null;
                slcHafta.DataBind();
            }
            #endregion

            #region Fill DersAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstDersBilgi  = PageOps.RunQueryForPage <DERS_BILGI>(DbCommandList.GET_DERS_BILGI, null, null);
            List <DERS_BILGI> lstCurrentDersBilgiObj = lstDersBilgi.Where <DERS_BILGI>(x => x.SINIF.ToString() == slcSinif.Value).ToList();


            foreach (var item in lstCurrentDersBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.DERS_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcDersAdi.DataSource     = lstDataSource.ToArray();
                slcDersAdi.DataTextField  = "Name";
                slcDersAdi.DataValueField = "Value";
                slcDersAdi.DataBind();
            }
            else
            {
                slcDersAdi.DataSource = null;
                slcDersAdi.DataBind();
            }
            #endregion

            #region Fill KonuAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstKonuBilgi  = PageOps.RunQueryForPage <DersKonuBilgiObj>(DbCommandList.GET_DERS_KONU_BILGI, null, null);
            List <DersKonuBilgiObj> lstCurrentKonuBilgiObj = lstKonuBilgi.Where <DersKonuBilgiObj>(x => x.DERS_GUID.ToString() == slcDersAdi.Value).ToList();
            foreach (var item in lstCurrentKonuBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.KONU,
                    Value = item.DERS_KONU_GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcKonuAdi.DataSource     = lstDataSource.ToArray();
                slcKonuAdi.DataTextField  = "Name";
                slcKonuAdi.DataValueField = "Value";
                slcKonuAdi.DataBind();
            }
            else
            {
                slcKonuAdi.DataSource = null;
                slcKonuAdi.DataBind();
            }
            #endregion

            return(true);
        }
Esempio n. 11
0
        private bool LoadParameters()
        {
            #region Fill Kişi

            PageOperations   PageOps       = new PageOperations();
            List <NameValue> lstDataSource = new List <NameValue>();
            lstKisiBilgi = PageOps.RunQueryForPage <HocaAndOgrenciObj>(DbCommandList.GET_HOCA_AND_OGRENCI, null, null);

            lstDataSource = new List <NameValue>();
            if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
            {
                lstKisiBilgi = lstKisiBilgi.Where(x => x.TIP == 1 && x.HOCA_GUID == ksfSI.HocaGuid).ToList();
                foreach (var item in lstKisiBilgi.Where(x => x.TIP == 1 && x.HOCA_GUID == ksfSI.HocaGuid).ToList())//Default olarak öğrenciler dolduruluyor.
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = item.AD_SOYAD,
                        Value = item.GUID.ToString()
                    });
                }
            }
            else
            {
                foreach (var item in lstKisiBilgi.Where(x => x.TIP == 1).ToList())//Default olarak öğrenciler dolduruluyor.
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = item.AD_SOYAD,
                        Value = item.GUID.ToString()
                    });
                }
            }


            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcKisi.DataSource     = lstDataSource.ToArray();
                slcKisi.DataTextField  = "Name";
                slcKisi.DataValueField = "Value";
                slcKisi.DataBind();
            }
            else
            {
                slcKisi.DataSource = null;
                slcKisi.DataBind();
            }
            #endregion

            #region Fill Hafta
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            List <HAFTA_BILGI> lstHaftaBilgi = PageOps.RunQueryForPage <HAFTA_BILGI>(DbCommandList.GET_HAFTA_BILGI, null, null);
            lstDataSource = new List <NameValue>();
            bool isFirstIteration = true;
            foreach (var item in lstHaftaBilgi)
            {
                if (isFirstIteration)
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = "Hafta Seç..",
                        Value = ""
                    });
                    isFirstIteration = false;
                }
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HAFTA_ADI + " : " + item.TARIH,
                    Value = item.HAFTA_ID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHafta.DataSource     = lstDataSource.ToArray();
                slcHafta.DataTextField  = "Name";
                slcHafta.DataValueField = "Value";
                slcHafta.DataBind();
            }
            else
            {
                slcHafta.DataSource = null;
                slcHafta.DataBind();
            }
            #endregion

            #region Fill Mahalle
            List <BOLGE_INFO> lstBolgeInfo = PageOps.RunQueryForPage <BOLGE_INFO>(DbCommandList.GET_BOLGE_INFO, null, null);

            lstDataSource.Clear();
            lstDataSource    = new List <NameValue>();
            isFirstIteration = true;
            foreach (var item in lstBolgeInfo)
            {
                if (isFirstIteration)
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = "Mahalle Seç..",
                        Value = ""
                    });
                    isFirstIteration = false;
                }
                lstDataSource.Add(new NameValue
                {
                    Name  = item.BOLGE_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcMahalle.DataSource     = lstDataSource.ToArray();
                slcMahalle.DataTextField  = "Name";
                slcMahalle.DataValueField = "Value";
                slcMahalle.DataBind();
            }
            else
            {
                slcMahalle.DataSource = null;
                slcMahalle.DataBind();
            }
            #endregion

            #region Fill Tip
            if (ksfSI.IsAdmin == 1)
            {
                NameValue[] NameValueArr = new NameValue[2];
                NameValueArr[0]       = new NameValue();
                NameValueArr[0].Name  = "Öğrenci";
                NameValueArr[0].Value = "1";
                NameValueArr[1]       = new NameValue();
                NameValueArr[1].Name  = "Hoca";
                NameValueArr[1].Value = "2";

                slcTip.DataSource     = NameValueArr;
                slcTip.DataTextField  = "Name";
                slcTip.DataValueField = "Value";
                slcTip.DataBind();
            }
            else
            {
                NameValue[] NameValueArr = new NameValue[1];
                NameValueArr[0]       = new NameValue();
                NameValueArr[0].Name  = "Öğrenci";
                NameValueArr[0].Value = "1";

                slcTip.DataSource     = NameValueArr;
                slcTip.DataTextField  = "Name";
                slcTip.DataValueField = "Value";
                slcTip.DataBind();
            }


            #endregion

            return(true);
        }
Esempio n. 12
0
        private bool LoadParameters()
        {
            #region Fill Hoca
            PageOperations    PageOps       = new PageOperations();
            List <NameValue>  lstDataSource = new List <NameValue>();
            List <HOCA_BILGI> lstHocaBilgi  = PageOps.RunQueryForPage <HOCA_BILGI>(DbCommandList.PRM_HOCA, null, null);

            if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
            {
                lstHocaBilgi = lstHocaBilgi.Where(x => x.GUID == ksfSI.HocaGuid).ToList();
            }

            lstDataSource = new List <NameValue>();
            foreach (var item in lstHocaBilgi)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HOCA_ADI + " " + item.HOCA_SOYADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHoca.DataSource     = lstDataSource.ToArray();
                slcHoca.DataTextField  = "Name";
                slcHoca.DataValueField = "Value";
                slcHoca.DataBind();
            }
            else
            {
                slcHoca.DataSource = null;
                slcHoca.DataBind();
            }
            #endregion

            #region Fill Hafta
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            List <HAFTA_BILGI> lstHaftaBilgi = PageOps.RunQueryForPage <HAFTA_BILGI>(DbCommandList.GET_HAFTA_BILGI, null, null);
            lstDataSource = new List <NameValue>();
            foreach (var item in lstHaftaBilgi)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HAFTA_ADI + " : " + item.TARIH,
                    Value = item.HAFTA_ID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHafta.DataSource     = lstDataSource.ToArray();
                slcHafta.DataTextField  = "Name";
                slcHafta.DataValueField = "Value";
                slcHafta.DataBind();
            }
            else
            {
                slcHafta.DataSource = null;
                slcHafta.DataBind();
            }
            #endregion

            #region Fill DersAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstDersBilgi  = PageOps.RunQueryForPage <DERS_BILGI>(DbCommandList.GET_DERS_BILGI, null, null);
            List <DERS_BILGI> lstCurrentDersBilgiObj = lstDersBilgi.Where <DERS_BILGI>(x => x.SINIF.ToString() == slcSinif.Value).ToList();


            foreach (var item in lstCurrentDersBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.DERS_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcDersAdi.DataSource     = lstDataSource.ToArray();
                slcDersAdi.DataTextField  = "Name";
                slcDersAdi.DataValueField = "Value";
                slcDersAdi.DataBind();
            }
            else
            {
                slcDersAdi.DataSource = null;
                slcDersAdi.DataBind();
            }
            #endregion

            #region Fill KonuAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstKonuBilgi  = PageOps.RunQueryForPage <DersKonuBilgiObj>(DbCommandList.GET_DERS_KONU_BILGI, null, null);
            List <DersKonuBilgiObj> lstCurrentKonuBilgiObj = lstKonuBilgi.Where <DersKonuBilgiObj>(x => x.DERS_GUID.ToString() == slcDersAdi.Value).ToList();
            foreach (var item in lstCurrentKonuBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.KONU,
                    Value = item.DERS_KONU_GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcKonuAdi.DataSource     = lstDataSource.ToArray();
                slcKonuAdi.DataTextField  = "Name";
                slcKonuAdi.DataValueField = "Value";
                slcKonuAdi.DataBind();
            }
            else
            {
                slcKonuAdi.DataSource = null;
                slcKonuAdi.DataBind();
            }
            #endregion

            #region Fill TakipDurumu
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            List <PRM_TAKIP_DURUMU> lstTakipDurumu = PageOps.RunQueryForPage <PRM_TAKIP_DURUMU>(DbCommandList.PRM_TAKIP_DURUMU, null, null);
            foreach (var item in lstTakipDurumu)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.DESCRIPTION,
                    Value = item.ID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcTakipDurumu.DataSource     = lstDataSource.ToArray();
                slcTakipDurumu.DataTextField  = "Name";
                slcTakipDurumu.DataValueField = "Value";
                slcTakipDurumu.DataBind();
            }
            else
            {
                slcTakipDurumu.DataSource = null;
                slcTakipDurumu.DataBind();
            }
            #endregion

            return(true);
        }
Esempio n. 13
0
        private bool LoadParameters()
        {
            #region Fill Hafta
            PageOperations    PageOps       = new PageOperations();
            List <NameValue>  lstDataSource = new List <NameValue>();
            List <HOCA_BILGI> lstHocaBilgi  = PageOps.RunQueryForPage <HOCA_BILGI>(DbCommandList.PRM_HOCA, null, null);
            lstDataSource = new List <NameValue>();

            List <HAFTA_BILGI> lstHaftaBilgi = PageOps.RunQueryForPage <HAFTA_BILGI>(DbCommandList.GET_HAFTA_BILGI, null, null);
            lstDataSource = new List <NameValue>();
            foreach (var item in lstHaftaBilgi)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.HAFTA_ADI + " : " + item.TARIH,
                    Value = item.HAFTA_ID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcHafta.DataSource     = lstDataSource.ToArray();
                slcHafta.DataTextField  = "Name";
                slcHafta.DataValueField = "Value";
                slcHafta.DataBind();
            }
            else
            {
                slcHafta.DataSource = null;
                slcHafta.DataBind();
            }
            #endregion

            #region Fill DersAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstDersBilgi  = PageOps.RunQueryForPage <DERS_BILGI>(DbCommandList.GET_DERS_BILGI, null, null);
            List <DERS_BILGI> lstCurrentDersBilgiObj = lstDersBilgi.Where <DERS_BILGI>(x => x.SINIF.ToString() == slcSinif.Value).ToList();


            foreach (var item in lstCurrentDersBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.DERS_ADI,
                    Value = item.GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcDersAdi.DataSource     = lstDataSource.ToArray();
                slcDersAdi.DataTextField  = "Name";
                slcDersAdi.DataValueField = "Value";
                slcDersAdi.DataBind();
            }
            else
            {
                slcDersAdi.DataSource = null;
                slcDersAdi.DataBind();
            }
            #endregion

            #region Fill KonuAdı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstKonuBilgi  = PageOps.RunQueryForPage <DersKonuBilgiObj>(DbCommandList.GET_DERS_KONU_BILGI, null, null);
            List <DersKonuBilgiObj> lstCurrentKonuBilgiObj = lstKonuBilgi.Where <DersKonuBilgiObj>(x => x.DERS_GUID.ToString() == slcDersAdi.Value).ToList();
            foreach (var item in lstCurrentKonuBilgiObj)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.KONU,
                    Value = item.DERS_KONU_GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcKonuAdi.DataSource     = lstDataSource.ToArray();
                slcKonuAdi.DataTextField  = "Name";
                slcKonuAdi.DataValueField = "Value";
                slcKonuAdi.DataBind();
            }
            else
            {
                slcKonuAdi.DataSource = null;
                slcKonuAdi.DataBind();
            }
            #endregion

            #region Test Adı
            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstTestBilgi  = PageOps.RunQueryForPage <TestBilgiObj>(DbCommandList.GET_TEST_BILGI, null, null);
            List <TestBilgiObj> lstCurrentTestBilgi = lstTestBilgi.Where <TestBilgiObj>(x => x.KONU_ID.ToString() == slcKonuAdi.Value).ToList();
            foreach (var item in lstCurrentTestBilgi)
            {
                lstDataSource.Add(new NameValue
                {
                    Name  = item.TEST_NO + ". " + item.TEST_ADI,
                    Value = item.TEST_GUID.ToString()
                });
            }

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcTestAdi.DataSource     = lstDataSource.ToArray();
                slcTestAdi.DataTextField  = "Name";
                slcTestAdi.DataValueField = "Value";
                slcTestAdi.DataBind();
            }
            else
            {
                slcTestAdi.DataSource = null;
                slcTestAdi.DataBind();
            }
            #endregion

            #region Fill Ogrenci

            lstDataSource = null;
            PageOps       = null;
            PageOps       = new PageOperations();
            lstDataSource = new List <NameValue>();
            lstOgrBilgi   = PageOps.RunQueryForPage <OGR_BILGI>(DbCommandList.PRM_OGR, null, null);

            lstDataSource = new List <NameValue>();
            if (ksfSI.RoleName.ToUpperInvariant() == RoleNames.HOCA.ToString())
            {
                lstOgrBilgi = lstOgrBilgi.Where(x => x.HOCA_GUID == ksfSI.HocaGuid).ToList();
                List <OGR_BILGI> lstCurrentOgrBilgiObj = lstOgrBilgi.Where <OGR_BILGI>(x => x.CLASS.ToString() == slcSinif.Value &&
                                                                                       x.HOCA_GUID == ksfSI.HocaGuid).ToList();
                foreach (var item in lstCurrentOgrBilgiObj)//Default olarak öğrenciler dolduruluyor.
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = item.NAME + " " + item.SURNAME,
                        Value = item.GUID.ToString()
                    });
                }
            }
            else
            {
                foreach (var item in lstOgrBilgi.Where(x => x.CLASS.ToString() == slcSinif.Value).ToList())//Default olarak öğrenciler dolduruluyor.
                {
                    lstDataSource.Add(new NameValue
                    {
                        Name  = item.NAME + " " + item.SURNAME,
                        Value = item.GUID.ToString()
                    });
                }
            }


            //List<OGR_BILGI> lstCurrentOgrBilgiObj = lstOgrBilgi.Where<OGR_BILGI>(x => x.CLASS.ToString() == slcSinif.Value).ToList();


            //foreach (var item in lstCurrentOgrBilgiObj)
            //{
            //    lstDataSource.Add(new NameValue
            //    {
            //        Name = item.NAME + " " + item.SURNAME,
            //        Value = item.GUID.ToString()
            //    });
            //}

            if (lstDataSource != null && lstDataSource.Count > 0)
            {
                slcOgr.DataSource     = lstDataSource.ToArray();
                slcOgr.DataTextField  = "Name";
                slcOgr.DataValueField = "Value";
                slcOgr.DataBind();
            }
            else
            {
                slcOgr.DataSource = null;
                slcOgr.DataBind();
            }
            #endregion

            return(true);
        }