private DataView GetData() { BPArchive bp = new BPArchive(); DSArchive = bp.SelectByArchiveTypeID(ArchiveTypeID); DSArchive.tbl_Archive.DefaultView.Sort = DSArchive.tbl_Archive.ArchiveDateColumn.ColumnName + " desc"; DSArchive.tbl_Archive.DefaultView.RowFilter = RowFilter("ArchiveTitle", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "ArchiveActive", lstActive.SelectedValue); return DSArchive.tbl_Archive.DefaultView; }
private void BindArchiveItems() { BPArchive bp = new BPArchive(); BEArchive ds = bp.SelectActiveFRByArchiveTypeIDWithROColumns(Convert.ToInt32(ArchiveTypes.ArchiveItem)); if (ds.tbl_Archive.Count > 0) { ds.tbl_Archive.DefaultView.Sort = ds.tbl_Archive.ArchiveDateColumn.ColumnName + " desc"; rptListings.DataSource = ds.tbl_Archive.DefaultView; rptListings.DataBind(); } else plcNoItems.Visible = true; }
protected void btnDelete_Click(object sender, EventArgs e) { BPArchive bpArchive = new BPArchive(); BEArchive dsArchive = bpArchive.SelectByID(ArchiveID); //BPPages bpPages = new BPPages(); //BEPages dsPages = bpPages.SelectByPageTypeIDAndPageTypeSpecificID(PageTypeID, ArchiveID); if (dsArchive.tbl_Archive.Count > 0) { //DeleteAllLinkInfo(); dsArchive.tbl_Archive[0].Delete(); bpArchive.Update(dsArchive); //if (dsPages.tbl_Pages.Count > 0) //{ // dsPages.tbl_Pages[0].Delete(); // bpPages.Update(dsPages); //} } BrowseRedirect(); }
private void SaveArchiveInfo() { bool isNew = false; BPArchive bp = new BPArchive(); BEArchive dsArchive = new BEArchive(); BEArchive.tbl_ArchiveRow Archive = null; if (ArchiveID > 0) { dsArchive = bp.SelectByID(ArchiveID); Archive = dsArchive.tbl_Archive.FindByArchiveID(ArchiveID); } if (Archive == null) { Archive = dsArchive.tbl_Archive.Newtbl_ArchiveRow(); isNew = true; } Archive.ArchiveTitle = txtArchiveTitle.Text.Trim(); if (txtArchiveTitleFR.Text.Trim() != "") Archive.ArchiveTitleFR = txtArchiveTitleFR.Text.Trim(); else Archive.SetArchiveTitleFRNull(); if (dtArchiveDate.Date != dtArchiveDate.MinDate) Archive.ArchiveDate = dtArchiveDate.Date; else Archive.SetArchiveDateNull(); if (txtArchiveDescription.Text.Trim() != "") Archive.ArchiveDescription = txtArchiveDescription.Text.Trim(); else Archive.SetArchiveDescriptionNull(); if (txtArchiveDescriptionFR.Text.Trim() != "") Archive.ArchiveDescriptionFR = txtArchiveDescriptionFR.Text.Trim(); else Archive.SetArchiveDescriptionFRNull(); if (docArchiveDocument.SelectedDocument > 0) Archive.ArchiveDocumentID = docArchiveDocument.SelectedDocument; else Archive.SetArchiveDocumentIDNull(); if (docArchiveDocumentFR.SelectedDocument > 0) Archive.ArchiveDocumentIDFR = docArchiveDocumentFR.SelectedDocument; else Archive.SetArchiveDocumentIDFRNull(); if (chkArchiveActive.Checked) { Archive.ArchiveActive = true; } else { Archive.ArchiveActive = false; } Archive.ArchiveActiveFR = chkArchiveActiveFR.Checked; Archive.DateModified = DateTime.Now; Archive.ModifiedByAdminID = Convert.ToInt32(PageUserID); if (isNew) { Archive.ArchiveTypeID = ArchiveTypeID; Archive.DateCreated = DateTime.Now; dsArchive.tbl_Archive.Addtbl_ArchiveRow(Archive); } bp.Update(dsArchive); //ArchiveID = Archive.ArchiveID; //SaveLinkInfo(isNew); }
private void BindArchiveInfo() { if (ArchiveID > 0) { BPArchive bp = new BPArchive(); BEArchive ds = bp.SelectByID(ArchiveID); BEArchive.tbl_ArchiveRow Archive = null; if (ds.tbl_Archive.Count > 0) { Archive = ds.tbl_Archive[0]; lblTitle.Text = "Edit " + Archive.ArchiveTitle; txtArchiveTitle.Text = Archive.ArchiveTitle; txtArchiveTitleFR.Text = Archive.IsArchiveTitleFRNull() ? "" : Archive.ArchiveTitleFR; if (!Archive.IsArchiveDateNull()) dtArchiveDate.Date = Archive.ArchiveDate; txtArchiveDescription.Text = Archive.IsArchiveDescriptionNull() ? "" : Archive.ArchiveDescription; txtArchiveDescriptionFR.Text = Archive.IsArchiveDescriptionFRNull() ? "" : Archive.ArchiveDescriptionFR; if (!Archive.IsArchiveDocumentIDNull()) docArchiveDocument.SelectedDocument = Archive.ArchiveDocumentID; if (!Archive.IsArchiveDocumentIDFRNull()) docArchiveDocumentFR.SelectedDocument = Archive.ArchiveDocumentIDFR; chkArchiveActive.Checked = Archive.ArchiveActive; chkArchiveActiveFR.Checked = Archive.ArchiveActiveFR; } } else { btnDelete.Visible = false; lblTitle.Text = "Add New " + SubTypeName; //edtArchiveContent.Text = ""; } }