/// <summary> /// Gallery/Genre/Subject/Reviews repeater nested within 'parentRptSingleWork_ItemDataBound' /// </summary> protected void parentRptSingleWork_ItemDataBound(Object Sender, RepeaterItemEventArgs e) { //Gallery Repeater: Child Repeater innerRptGallery = (Repeater)e.Item.FindControl("rptGallery"); GalleryCollection gl = new GalleryCollection(false); gl.FetchForId(ac[0].GalleryID); innerRptGallery.DataSource = gl; innerRptGallery.DataBind(); //Genre Repeater: Child Repeater innerRptGenre = (Repeater)e.Item.FindControl("rptGenre"); GenreCollection _gCol = new GenreCollection(false); _gCol.FetchByArtWorkID(artWorkId); innerRptGenre.DataSource = _gCol; innerRptGenre.DataBind(); //Second Genre Repeater (For Related Artworks in Accordian): Child Repeater innerRptRelatedArt = (Repeater)e.Item.FindControl("rptRelatedArt"); GenreCollection _gCol2 = new GenreCollection(false); _gCol2.FetchByArtWorkID(artWorkId); innerRptRelatedArt.DataSource = _gCol2; innerRptRelatedArt.DataBind(); //Subject Repeater: Child Repeater innerRptSubject = (Repeater)e.Item.FindControl("rptSubject"); SubjectCollection _sCol = new SubjectCollection(false); _sCol.FetchByArtWorkId(artWorkId); innerRptSubject.DataSource = _sCol; innerRptSubject.DataBind(); //Sales Repeater (Using date created---> Order/OrderDetails) Repeater innerRptOrders = (Repeater)e.Item.FindControl("rptSalesDateCreatedList"); OrdersCollection _ordCol = new OrdersCollection(); _ordCol.FetchByArtworkID(artWorkId); innerRptOrders.DataSource = _ordCol; innerRptOrders.DataBind(); //Getting the Reviews artReview.FetchReviewsByArtWorkId(artWorkId); if (!artReview.IsEmpty) { rptReview.DataSource = artReview; rptReview.DataBind(); } else { emptyReview.Text = "There is no review for this artwork "; } }
protected string GetSubjectDetails(SubjectCollection collection) { var table = "<legend>Subjects</legend><table cellpadding='0' cellspacing='0' border='0' class='table table-striped table-bordered sDataTable'>"; table += "<thead>"; table += "<tr>"; table += "<th>Subject Name</th>"; table += "<th>View</th>"; table += "<th>Edit</th>"; table += "<th>Delete</th>"; table += "</tr>"; table += "</thead>"; table += "<tbody>"; foreach (SubjectModal modal in collection) { table += "<tr>"; table += "<td>" + modal.SubjectName + "</td>"; table += "<td><a href='#'><i class='icon-eye-open icon-black'></i></a></td>"; table += "<td><a href='#'><i class='icon-pencil icon-black'></i></a></td>"; table += "<td><a href='#'><i class='icon-remove icon-black'></i></a></td>"; table += "</tr>"; } table += "</tbody>"; table += "</table>"; return table; }
/// <summary> /// Set up Subjects repeater, all subjects, not top ten /// </summary> protected void SetSubjectNav() { SubjectCollection subjects = new SubjectCollection(true); if (subjects.Count > 0) { SubjectsTopTen.DataSource = subjects; SubjectsTopTen.DataBind(); } }
private void LoadSubjects() { var subjects = new SubjectCollection(); subjects.LoadAllItemsFromDb(); cboSubject.Items.Clear(); foreach (var item in subjects.Items) { cboSubject.Items.Add(item); } }
public Student(StudentRecord income_stu, ScoreType score_type, int semesters, List <string> printEntries) { _dept = income_stu.Department; _class = income_stu.RefClass == null ? "" : income_stu.RefClass.ClassName; _seat_no = income_stu.SeatNo; _student_number = income_stu.StudentNumber; _name = income_stu.StudentName; _student = income_stu; _score_type = score_type; _subjects = new SubjectCollection(); _entries = new EntryCollection(); ProcessScoreList(semesters, printEntries); }
public override SubjectCollection GetSupportedSubjects() { SubjectCollection subjects = new SubjectCollection(); int index; foreach (ServiceItemData sid in services) { index = subjects.BinarySearch(sid.Subject); if (index < 0) { subjects.Insert(~index, sid.Subject); } } return(subjects); }
/// <summary> /// Grabs the Subjects List repeater of artworks according to SubjectId query string. /// </summary> private void SetUpRepeaterSubjects(int subjectID) { SubjectCollection sc = null; if (subjectID == -1) { sc = new SubjectCollection(true); } else { sc = new SubjectCollection(false); sc.FetchById(subjectID); } rptSubjects.DataSource = sc; rptSubjects.DataBind(); }
void BLanguageFilterClick(object sender, EventArgs e) { DefaultTranslateProfile pf = defaultProfile; DefaultProfileLanguagesForm form = new DefaultProfileLanguagesForm(pf); if (form.ShowDialog(this) == DialogResult.OK) { SubjectCollection subjects = pf.GetSupportedSubjects(); SubjectCollection subjectsToDelete = new SubjectCollection(); foreach (string subject in pf.Subjects) { if (!subjects.Contains(subject)) { subjectsToDelete.Add(subject); } } foreach (string subject in subjectsToDelete) { pf.Subjects.Remove(subject); } LanguagePairCollection toDelete = new LanguagePairCollection(); foreach (LanguagePair lp in pf.History) { if (pf.DisabledSourceLanguages.Contains(lp.From) || pf.DisabledTargetLanguages.Contains(lp.To)) { toDelete.Add(lp); } } foreach (LanguagePair lp in toDelete) { pf.History.Remove(lp); } } form.Dispose(); changed = true; }
public override SubjectCollection GetSupportedSubjects() { if (!disabledLanguagesAlreadySet) { return(Manager.Subjects); } else { PrepareProcessing(); SubjectCollection subjects = new SubjectCollection(); int index; foreach (ServiceItem item in Manager.ServiceItems) { foreach (LanguagePair lp in item.SupportedTranslations) { if (disabledSourceLanguages.BinarySearch(lp.From) >= 0) { continue; } if (disabledTargetLanguages.BinarySearch(lp.To) >= 0) { continue; } foreach (string subject in item.SupportedSubjects) { index = subjects.BinarySearch(subject); if (index < 0) { subjects.Insert(~index, subject); } } break; } } return(subjects); } }
void AFilterLanguagesExecute(object sender, EventArgs e) { DefaultTranslateProfile pf = currentProfile as DefaultTranslateProfile; if(pf == null) return; pf.DisabledLanguagesAlreadySet = true; DefaultProfileLanguagesForm form = new DefaultProfileLanguagesForm(pf); if(form.ShowDialog(this) == DialogResult.OK) { SubjectCollection subjects = pf.GetSupportedSubjects(); SubjectCollection subjectsToDelete = new SubjectCollection(); foreach(string subject in pf.Subjects) { if(!subjects.Contains(subject)) subjectsToDelete.Add(subject); } foreach(string subject in subjectsToDelete) pf.Subjects.Remove(subject); LanguagePairCollection toDelete = new LanguagePairCollection(); foreach(LanguagePair lp in pf.History) { if(pf.DisabledSourceLanguages.Contains(lp.From) || pf.DisabledTargetLanguages.Contains(lp.To)) { toDelete.Add(lp); } } foreach(LanguagePair lp in toDelete) pf.History.Remove(lp); languageSelector.Profile = currentProfile; } form.Dispose(); }
void SetSubjects(SubjectCollection supportedSubjects, SubjectCollection subjects) { this.supportedSubjects = supportedSubjects; this.subjects = subjects; LoadSubjects(); }
void BLanguageFilterClick(object sender, EventArgs e) { DefaultTranslateProfile pf = defaultProfile; DefaultProfileLanguagesForm form = new DefaultProfileLanguagesForm(pf); if(form.ShowDialog(this) == DialogResult.OK) { SubjectCollection subjects = pf.GetSupportedSubjects(); SubjectCollection subjectsToDelete = new SubjectCollection(); foreach(string subject in pf.Subjects) { if(!subjects.Contains(subject)) subjectsToDelete.Add(subject); } foreach(string subject in subjectsToDelete) pf.Subjects.Remove(subject); LanguagePairCollection toDelete = new LanguagePairCollection(); foreach(LanguagePair lp in pf.History) { if(pf.DisabledSourceLanguages.Contains(lp.From) || pf.DisabledTargetLanguages.Contains(lp.To)) { toDelete.Add(lp); } } foreach(LanguagePair lp in toDelete) pf.History.Remove(lp); } form.Dispose(); changed = true; }
protected void gvResult_ItemDataBound(object sender, DataGridItemEventArgs e) { SubjectCollection dt = ((SubjectCollection)this.gvResult.DataSource); if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { PubEntAdmin.BLL.Subject l_conf = dt[e.Item.ItemIndex]; e.Item.Cells[0].Text = l_conf.CannotRem.ToString(); ((Label)e.Item.Cells[2].Controls[1]).Text = Server.HtmlEncode(l_conf.SubjName); //---------------------------------------- string a = ""; if (l_conf.InNCIPL) { a = "NCIPL"; } if (l_conf.InROO) { if (a.Length != 0) { a += "<br />"; } a += "NCIPLcc"; } if (l_conf.InExh) { if (a.Length != 0) { a += "<br />"; } a += "Exhibit"; } if (l_conf.InCatalog) { if (a.Length != 0) { a += "<br />"; } a += "Catalog"; } if (a.Length != 0) { ((Label)e.Item.Cells[3].Controls[1]).Text = a; } else { ((Label)e.Item.Cells[3].Controls[1]).Text = "N/A"; } //---------------------------------------- ((Label)e.Item.Cells[4].Controls[1]).Text = l_conf.HasSubCat.ToString(); //---------------------------------------- ((Label)e.Item.FindControl("lblStatus1")).Text = l_conf.Active ? "Active" : "Inactive"; //---------------------------------------- //delete btn col Button l_able = e.Item.Cells[7].FindControl("lnkbtnDel") as Button; if (l_conf.Active) { l_able.Text = "Inactivate"; Panel l_pnl = e.Item.Cells[7].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Subject [" + Server.HtmlEncode(l_conf.SubjName) + "]?<br />NOTE: If the Category has SubCategories they will also be inactivated!"; } else { l_able.Text = "Activate"; Panel l_pnl = e.Item.Cells[7].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Subject [" + Server.HtmlEncode(l_conf.SubjName) + "]?"; } } else if (e.Item.ItemType == ListItemType.EditItem) { PubEntAdmin.BLL.Subject l_conf = dt[e.Item.ItemIndex]; e.Item.Cells[0].Text = l_conf.CannotRem.ToString(); ((TextBox)e.Item.Cells[2].Controls[1]).Text = Server.HtmlEncode(l_conf.SubjName); //---------------------------------------- if (l_conf.InNCIPL) { ((LiveIntSel)e.Item.Cells[3].Controls[1]).InNCIPL = true; } if (l_conf.InROO) { ((LiveIntSel)e.Item.Cells[3].Controls[1]).InROO = true; } if (l_conf.InExh) { ((LiveIntSel)e.Item.Cells[3].Controls[1]).InExh = true; } if (l_conf.InCatalog) { ((LiveIntSel)e.Item.Cells[3].Controls[1]).InCatalog = true; } //---------------------------------------- if (e.Item.Cells[4].Controls[1] is CheckBox) { CheckBox l_chkboxRemove = ((CheckBox)e.Item.FindControl("ckboxHasSubCat")); l_chkboxRemove.Attributes.Add("onclick", @"(!this.checked)?alert('NOTE:\nALL the SubCategories and SubSubCategories assigned\nto this Category will be disabled!'):''"); ((CheckBox)e.Item.Cells[4].Controls[1]).Checked = l_conf.HasSubCat; } //---------------------------------------- ((Label)e.Item.FindControl("lblStatus2")).Text = l_conf.Active ? "Active" : "Inactive"; //---------------------------------------- if (e.Item.Cells[6].Controls[2] is Button) { Button l_btnCancel = ((Button)e.Item.Cells[6].Controls[2]); l_btnCancel.ID = "gvResult_Cancel"; Panel l_panel = new Panel(); l_panel.ID = "l_panel"; l_panel.CssClass = "modalPopup"; l_panel.Style.Add("display", "none"); l_panel.Width = Unit.Pixel(233); Label l_label = new Label(); l_label.Text = "Are you sure you want to continue?"; HtmlGenericControl l_div = new HtmlGenericControl(); Button l_ok = new Button(); Button l_cancel = new Button(); l_ok.ID = "l_ok"; l_ok.Text = "OK"; l_ok.CssClass = "btn"; l_cancel.ID = "l_cancel"; l_cancel.Text = "Cancel"; l_cancel.CssClass = "btn"; l_div.Controls.Add(l_ok); l_div.Controls.Add(new LiteralControl(" ")); l_div.Controls.Add(l_cancel); l_div.Attributes.Add("align", "center"); l_panel.Controls.Add(l_label); l_panel.Controls.Add(new LiteralControl("<br>")); l_panel.Controls.Add(new LiteralControl("<br>")); l_panel.Controls.Add(l_div); ModalPopupExtender l_mpe = new ModalPopupExtender(); l_mpe.ID = "l_mpe"; l_mpe.TargetControlID = l_btnCancel.ID; l_mpe.PopupControlID = l_panel.ID; l_mpe.BackgroundCssClass = "modalBackground"; l_mpe.DropShadow = true; l_mpe.OkControlID = l_ok.ID; l_mpe.CancelControlID = l_cancel.ID; ConfirmButtonExtender l_cbe = new ConfirmButtonExtender(); l_cbe.TargetControlID = l_btnCancel.ID; l_cbe.ConfirmText = ""; l_cbe.DisplayModalPopupID = l_mpe.ID; e.Item.Cells[5].Controls.Add(l_panel); e.Item.Cells[5].Controls.Add(l_mpe); e.Item.Cells[5].Controls.Add(l_cbe); } //---------------------------------------- //delete btn col Button l_able = e.Item.Cells[7].FindControl("lnkbtnDel") as Button; if (l_conf.Active) { l_able.Text = "Inactivate"; Panel l_pnl = e.Item.Cells[7].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Subject [" + Server.HtmlEncode(l_conf.SubjName) + "]?<br />NOTE: If the Category has SubCategories they will also be inactivated!"; } else { l_able.Text = "Activate"; Panel l_pnl = e.Item.Cells[7].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Subject [" + Server.HtmlEncode(l_conf.SubjName) + "]?"; } } }
public override SubjectCollection GetSupportedSubjects() { if(!disabledLanguagesAlreadySet) return Manager.Subjects; else { PrepareProcessing(); SubjectCollection subjects = new SubjectCollection(); int index; foreach(ServiceItem item in Manager.ServiceItems) { foreach(LanguagePair lp in item.SupportedTranslations) { if(disabledSourceLanguages.BinarySearch(lp.From) >= 0) continue; if(disabledTargetLanguages.BinarySearch(lp.To) >= 0) continue; foreach(string subject in item.SupportedSubjects) { index = subjects.BinarySearch(subject); if(index < 0) subjects.Insert(~index,subject); } break; } } return subjects; } }