private DataView GetData() { BPPolicies bp = new BPPolicies(); DSPolicies = bp.SelectByPoliciesTypeID(PoliciesTypeID); DSPolicies.tbl_Policies.DefaultView.Sort = DSPolicies.tbl_Policies.PoliciesDateColumn.ColumnName + " desc"; DSPolicies.tbl_Policies.DefaultView.RowFilter = RowFilter("PoliciesTitle", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "PoliciesActive", lstActive.SelectedValue); return DSPolicies.tbl_Policies.DefaultView; }
private void BindPoliciesItems() { BPPolicies bp = new BPPolicies(); BEPolicies ds = bp.SelectActiveByPoliciesTypeIDWithROColumns(Convert.ToInt32(PoliciesTypes.PolicyItem)); if (ds.tbl_Policies.Count > 0) { ds.tbl_Policies.DefaultView.Sort = ds.tbl_Policies.PoliciesDateColumn.ColumnName + " desc"; rptListings.DataSource = ds.tbl_Policies.DefaultView; rptListings.DataBind(); } else plcNoItems.Visible = true; }
private void SavePoliciesInfo() { bool isNew = false; BPPolicies bp = new BPPolicies(); BEPolicies dsPolicies = new BEPolicies(); BEPolicies.tbl_PoliciesRow Policies = null; if (PoliciesID > 0) { dsPolicies = bp.SelectByID(PoliciesID); Policies = dsPolicies.tbl_Policies.FindByPoliciesID(PoliciesID); } if (Policies == null) { Policies = dsPolicies.tbl_Policies.Newtbl_PoliciesRow(); isNew = true; } Policies.PoliciesTitle = txtPoliciesTitle.Text.Trim(); if (txtPoliciesTitleFR.Text.Trim() != "") Policies.PoliciesTitleFR = txtPoliciesTitleFR.Text.Trim(); else Policies.SetPoliciesTitleFRNull(); if (dtPoliciesDate.Date != dtPoliciesDate.MinDate) Policies.PoliciesDate = dtPoliciesDate.Date; else Policies.SetPoliciesDateNull(); if (txtPoliciesDescription.Text.Trim() != "") Policies.PoliciesDescription = txtPoliciesDescription.Text.Trim(); else Policies.SetPoliciesDescriptionNull(); if (txtPoliciesDescriptionFR.Text.Trim() != "") Policies.PoliciesDescriptionFR = txtPoliciesDescriptionFR.Text.Trim(); else Policies.SetPoliciesDescriptionFRNull(); if (docPoliciesDocument.SelectedDocument > 0) Policies.PoliciesDocumentID = docPoliciesDocument.SelectedDocument; else Policies.SetPoliciesDocumentIDNull(); if (docPoliciesDocumentFR.SelectedDocument > 0) Policies.PoliciesDocumentIDFR = docPoliciesDocumentFR.SelectedDocument; else Policies.SetPoliciesDocumentIDFRNull(); if (chkPoliciesActive.Checked) { Policies.PoliciesActive = true; } else { Policies.PoliciesActive = false; } Policies.PoliciesActiveFR = chkPoliciesActiveFR.Checked; Policies.DateModified = DateTime.Now; Policies.ModifiedByAdminID = Convert.ToInt32(PageUserID); if (isNew) { Policies.PoliciesTypeID = PoliciesTypeID; Policies.DateCreated = DateTime.Now; dsPolicies.tbl_Policies.Addtbl_PoliciesRow(Policies); } bp.Update(dsPolicies); //PoliciesID = Policies.PoliciesID; //SaveLinkInfo(isNew); }
protected void btnDelete_Click(object sender, EventArgs e) { BPPolicies bpPolicies = new BPPolicies(); BEPolicies dsPolicies = bpPolicies.SelectByID(PoliciesID); //BPPages bpPages = new BPPages(); //BEPages dsPages = bpPages.SelectByPageTypeIDAndPageTypeSpecificID(PageTypeID, PoliciesID); if (dsPolicies.tbl_Policies.Count > 0) { //DeleteAllLinkInfo(); dsPolicies.tbl_Policies[0].Delete(); bpPolicies.Update(dsPolicies); //if (dsPages.tbl_Pages.Count > 0) //{ // dsPages.tbl_Pages[0].Delete(); // bpPages.Update(dsPages); //} } BrowseRedirect(); }
private void BindPoliciesInfo() { if (PoliciesID > 0) { BPPolicies bp = new BPPolicies(); BEPolicies ds = bp.SelectByID(PoliciesID); BEPolicies.tbl_PoliciesRow Policies = null; if (ds.tbl_Policies.Count > 0) { Policies = ds.tbl_Policies[0]; lblTitle.Text = "Edit " + Policies.PoliciesTitle; txtPoliciesTitle.Text = Policies.PoliciesTitle; txtPoliciesTitleFR.Text = Policies.IsPoliciesTitleFRNull() ? "" : Policies.PoliciesTitleFR; if (!Policies.IsPoliciesDateNull()) dtPoliciesDate.Date = Policies.PoliciesDate; txtPoliciesDescription.Text = Policies.IsPoliciesDescriptionNull() ? "" : Policies.PoliciesDescription; txtPoliciesDescriptionFR.Text = Policies.IsPoliciesDescriptionFRNull() ? "" : Policies.PoliciesDescriptionFR; if (!Policies.IsPoliciesDocumentIDNull()) docPoliciesDocument.SelectedDocument = Policies.PoliciesDocumentID; if (!Policies.IsPoliciesDocumentIDFRNull()) docPoliciesDocumentFR.SelectedDocument = Policies.PoliciesDocumentIDFR; chkPoliciesActive.Checked = Policies.PoliciesActive; chkPoliciesActiveFR.Checked = Policies.PoliciesActiveFR; } } else { btnDelete.Visible = false; lblTitle.Text = "Add New " + SubTypeName; //edtPoliciesContent.Text = ""; } }