private void PopulateDepartmentsComboBox()
        {
            string DepartmentQuery = DepartmentsRepository.GetQuery();
            string SectionsQuery   = SectionsRepository.GetQuery();

            Lists.FillDropDownList2(SectionsQuery, "Description", DepartmentQuery, "Title", DepartmentComboBox);
        }
Ejemplo n.º 2
0
        public void FillData()
        {
            BasicRepository _basic = new BasicRepository();

            BasicContants.StoredProcedure = "GetGender";
            Genders    = _basic.Get();
            GenderList = Genders.ToGenderSelectListItems(GenderID);

            BasicContants.StoredProcedure = "GetStudentType";
            Students    = _basic.Get();
            StudentList = Students.ToStudentTypeSelectListItems(StudentTypeID);

            SectionsRepository _section = new SectionsRepository();

            BasicContants.StoredProcedure = "GetFullSectionName";
            Sections    = _section.Get();
            SectionList = Sections.ToSectionSelectListItems(SectionID);

            ParentRepository _parent = new ParentRepository();

            Parents    = _parent.Get();
            ParentList = Parents.ToParentSelectListItems(ParentID);

            TransportRepository _transport = new TransportRepository();

            Transports    = _transport.Get();
            TransportList = Transports.ToTransportSelectListItems(TransportID);
        }
Ejemplo n.º 3
0
 public PostsRepository(BioRepositoryContext <Post> repositoryContext,
                        SectionsRepository sectionsRepository,
                        TagsRepository tagsRepository,
                        IUserDataProvider?userDataProvider = null) : base(repositoryContext,
                                                                          sectionsRepository, userDataProvider)
 {
     _tagsRepository = tagsRepository;
 }
Ejemplo n.º 4
0
 public PostsRepository(BioRepositoryContext <Post <TUserPk> > repositoryContext,
                        SectionsRepository sectionsRepository,
                        TagsRepository tagsRepository,
                        IUserDataProvider <TUserPk>?userDataProvider = null) : base(repositoryContext,
                                                                                    sectionsRepository)
 {
     _tagsRepository   = tagsRepository;
     _userDataProvider = userDataProvider;
 }
        /// <summary>
        ///  Initializes the view model.
        /// </summary>

        public virtual void Init(Repository repository, SectionsRepository sectionsRepository)
        {
            SectionSelectListItems = new SelectList(
                sectionsRepository.GetList(includeRelatedEntities: false),
                "Id", "Name");

            CategorySelectListItems = new SelectList(
                repository.GetCategories(),
                "Id", "Name");
        }
Ejemplo n.º 6
0
        protected void GridviewSiniflar_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Classroom k = (Classroom)e.Row.DataItem;
                if (k.IsActive == true)
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).CssClass      = "btn btn-danger btn-mini";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Pasif Edilecek');";
                }
                else
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).CssClass      = "btn btn-success btn-mini";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Aktif Edilecek');";
                }


                int id;

                Label        lblgelenid   = (Label)e.Row.FindControl("lblID");
                Label        lblsecid     = (Label)e.Row.FindControl("Label1");
                Label        lbltrgelenid = (Label)e.Row.FindControl("lbltr");
                DropDownList ddl1         = (DropDownList)e.Row.FindControl("dropdownBolum");
                DropDownList ddl2         = (DropDownList)e.Row.FindControl("dropdownEgitmen");
                Label        lbldurum     = (Label)e.Row.FindControl("lbldurum");

                SectionsRepository bolum   = new SectionsRepository();
                TrainerRepository  egitmen = new TrainerRepository();
                int     sectionid          = Convert.ToInt32(lblsecid.Text);
                Section sec = new Section();
                sec                 = bolum.TekGetir(sectionid);
                ddl1.DataSource     = bolum.HepsiniGetir();
                ddl1.DataTextField  = "Name";
                ddl1.DataValueField = "Id";
                ddl1.SelectedValue  = sec.Id.ToString();
                ddl1.DataBind();
                int     traineridd = Convert.ToInt32(lbltrgelenid.Text);
                Trainer tid        = new Trainer();
                tid = egitmen.TekGetir(traineridd);
                ddl2.SelectedValue  = tid.Id.ToString();
                ddl2.DataSource     = egitmen.HepsiniGetir();
                ddl2.DataTextField  = "FullName";
                ddl2.DataValueField = "Id";
                ddl2.DataBind();
            }
        }
Ejemplo n.º 7
0
 public BRCPostsPublisher(IPBContentPublisher ipbContentPublisher,
                          TwitterContentPublisher twitterContentPublisher,
                          FacebookContentPublisher facebookContentPublisher, SitesRepository sitesRepository,
                          SectionsRepository sectionsRepository,
                          PropertiesProvider propertiesProvider, IOptions <BrcApiOptions> options)
 {
     _ipbContentPublisher      = ipbContentPublisher;
     _twitterContentPublisher  = twitterContentPublisher;
     _facebookContentPublisher = facebookContentPublisher;
     _sitesRepository          = sitesRepository;
     _sectionsRepository       = sectionsRepository;
     _propertiesProvider       = propertiesProvider;
     _options = options.Value;
 }
Ejemplo n.º 8
0
        protected override async Task AfterLoadAsync(Post[] entities)
        {
            await base.AfterLoadAsync(entities);

            var sectionsIds = entities.SelectMany(p => p.SectionIds).Distinct().ToArray();
            var sections    = await SectionsRepository.GetByIdsAsync(sectionsIds);

            var tagIds = entities.SelectMany(p => p.TagIds).Distinct().ToArray();
            var tags   = await _tagsRepository.GetByIdsAsync(tagIds);

            foreach (var entity in entities)
            {
                entity.Sections = sections.Where(s => entity.SectionIds.Contains(s.Id)).ToList();
                entity.Tags     = tags.Where(t => entity.TagIds.Contains(t.Id)).ToList();
            }
        }
Ejemplo n.º 9
0
        protected override async Task AfterLoadAsync(Post <TUserPk>[] entities)
        {
            await base.AfterLoadAsync(entities);

            var sectionsIds = entities.SelectMany(p => p.SectionIds).Distinct().ToArray();
            var sections    = await SectionsRepository.GetByIdsAsync(sectionsIds);

            var tagIds = entities.SelectMany(p => p.TagIds).Distinct().ToArray();
            var tags   = await _tagsRepository.GetByIdsAsync(tagIds);

            var userIds = entities.Select(e => e.AuthorId).Distinct().ToArray();
            var users   = await _userDataProvider.GetDataAsync(userIds);

            foreach (var entity in entities)
            {
                entity.Sections = sections.Where(s => entity.SectionIds.Contains(s.Id)).ToList();
                entity.Tags     = tags.Where(t => entity.TagIds.Contains(t.Id)).ToList();
                entity.Author   = users.FirstOrDefault(d => d.Id.Equals(entity.AuthorId));
            }
        }
Ejemplo n.º 10
0
        protected void GridviewSiniflar_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Trainer k = (Trainer)e.Row.DataItem;

                if (k.IsActive == true)
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ForeColor     = System.Drawing.Color.Red;
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Pasif Edilecek');";
                }
                else
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ForeColor     = System.Drawing.Color.Green;
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Aktif Edilecek');";
                }


                int id;

                Label        lblsecid     = (Label)e.Row.FindControl("Label1");
                Label        lbltrgelenid = (Label)e.Row.FindControl("lbltr");
                DropDownList ddl1         = (DropDownList)e.Row.FindControl("dropdownBolum");
                Label        lbldurum     = (Label)e.Row.FindControl("lbldurum");

                SectionsRepository bolum = new SectionsRepository();
                int     sectionid        = Convert.ToInt32(lblsecid.Text);
                Section sec = new Section();
                sec                 = bolum.TekGetir(sectionid);
                ddl1.DataSource     = bolum.HepsiniGetir();
                ddl1.DataTextField  = "Name";
                ddl1.DataValueField = "Id";
                ddl1.SelectedValue  = sec.Id.ToString();
                ddl1.DataBind();
            }
        }
 private void AddSectionsButton_Click(object sender, EventArgs e)
 {
     if (SectionsNameTextBox.Text.Length == 0)
     {
         Warning();
     }
     else
     {
         bool isUnique = SectionsRepository.CheckUnique(SectionsNameTextBox.Text);
         if (isUnique != true)
         {
             bool isSectionAdded = SectionsRepository.InsertSection(SectionsNameTextBox.Text);
             if (isSectionAdded == true)
             {
                 SectionsNameTextBox.Text = "";
             }
         }
         else
         {
             SectionsNameTextBox.Text = "";
         }
     }
 }
Ejemplo n.º 12
0
 public SectionController()
 {
     _sectionsRepository = new SectionsRepository(Context);
 }
Ejemplo n.º 13
0
 public override void Init(Repository repository, SectionsRepository sectionsRepository)
 {
     base.Init(repository, sectionsRepository);
 }
 public TestContentRepository(BioRepositoryContext <TestContent> repositoryContext,
                              SectionsRepository sectionsRepository) : base(repositoryContext,
                                                                            sectionsRepository)
 {
 }
 public ResourcesController()
 {
     _resourcesRepository = new ResourcesRepository(Context);
     _sectionsRepository  = new SectionsRepository(Context);
 }