protected void AddLookup(object sender) { string longdesc = this.txtSpLongDesc.Text; string code = this.txtSpCode.Text; this.gvResult.DataSource = LU_DAL.GetSponsorsbyDesc(longdesc); this.gvResult.DataKeyField = "SponsorID"; this.gvResult.DataBind(); if (gvResult.Items.Count > 0) { pnlResult.Visible = true; this.lblMessage.Text = "The Sponsor already existed. Please check below for duplicate record(s)."; } else { int iSponsorid = LU_DAL.AddSponsor(longdesc, code); if (iSponsorid > 0) { this.lblMessage.Text = "The Sponsor has been saved."; this.txtSpCode.Text = ""; this.txtSpLongDesc.Text = ""; this.pnlResult.Visible = false; this.txtFind.Text = ""; } else { this.lblMessage.Text = "The Sponsor has not been saved."; } } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { ProductFormatCollection dt = ((ProductFormatCollection)this.gvResult.DataSource); PubEntAdmin.BLL.ProductFormat l_conf = dt[e.Item.ItemIndex]; int Pftid = l_conf.PftID; string Pftname = l_conf.PftName; string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean pftExist = LU_DAL.PftExist(Pftid); if (pftExist == false) { LU_DAL.DeleteProductFormatLU(Pftid); Response.Redirect("~/LookupMgmt.aspx?sub=prodformat"); } else if (pftExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateProductFormatLU(Pftid, Pftname, Active); Response.Redirect("~/LookupMgmt.aspx?sub=prodformat"); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { SponsorCollection dt = ((SponsorCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Sponsor l_spon = dt[e.Item.DataSetIndex]; int Sponid = l_spon.SponsorID; string SpLongDesc = l_spon.LongDescription; //string SpDesc = l_spon.Description; string SpCode = l_spon.SponsorCode; string Activestatus = ((Button)e.Item.Cells[6].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean sponExist = LU_DAL.SponsorExist(Sponid); if (sponExist == false) { LU_DAL.DeleteSponsorLU(Sponid); this.BindData(); } else if (sponExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[7].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateSponsorLU(Sponid, SpCode, SpLongDesc, Active); this.BindData(); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { OwnerCollection dt = ((OwnerCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Owner l_owner = dt[e.Item.DataSetIndex]; int Ownerid = l_owner.OwnerID; string Fname = l_owner.FirstName; string Lname = l_owner.LastName; string Minitial = l_owner.MiddleInitial; string Activestatus = ((Button)e.Item.Cells[7].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean ownerExist = LU_DAL.OwnerExist(Ownerid); if (ownerExist == false) { LU_DAL.DeleteOwnerLU(Ownerid); this.BindData(); } else if (ownerExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[8].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { LU_DAL.UpdateOwnerLU(Ownerid, Fname, Lname, Minitial); this.BindData(); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { Label confid = ((Label)e.Item.Cells[0].FindControl("sConfid")); LU_DAL.DeleteConfLU(System.Convert.ToInt32(confid.Text.Trim())); Response.Redirect("Conference.aspx", false); }
protected void BindTimeoutData() { DataSet ds = new DataSet(); ds = LU_DAL.displayTimeouts(); if (ds.Tables[0].Rows.Count > 0) { this.pnlTimoutEdit.Visible = false; this.pnlTimeoutDisplay.Visible = true; this.lblRotationTime.Text = ds.Tables[0].Rows[0].ItemArray[0].ToString(); this.lblPageTime.Text = ds.Tables[0].Rows[0].ItemArray[1].ToString(); this.lblSessionTime.Text = ds.Tables[0].Rows[0].ItemArray[2].ToString(); this.txtRotateTime.Text = ds.Tables[0].Rows[0].ItemArray[0].ToString(); this.txtPageTime.Text = ds.Tables[0].Rows[0].ItemArray[1].ToString(); this.txtSessionTime.Text = ds.Tables[0].Rows[0].ItemArray[2].ToString(); } else { this.pnlTimoutEdit.Visible = true; this.pnlTimeoutDisplay.Visible = false; btnAddTime.Visible = true; } }
protected void AddLookup() { string fname = this.txtFName.Text.Trim(); string lname = this.txtLName.Text.Trim(); string minitial = this.txtMInit.Text.Trim(); this.gvResult.DataSource = LU_DAL.GetOwnerByFullname(fname, lname, minitial); this.gvResult.DataKeyField = "OwnerID"; this.gvResult.DataBind(); if (gvResult.Items.Count > 0) { pnlResult.Visible = true; this.lblMessage.Text = "The Owner already existed. Please check below for duplicate record(s)."; } else { int iOwnerid = LU_DAL.AddOwner(fname, lname, minitial); if (iOwnerid > 0) { this.lblMessage.Text = "The Owner has been saved."; this.txtFName.Text = ""; this.txtLName.Text = ""; this.txtMInit.Text = ""; this.pnlResult.Visible = false; this.txtFind.Text = ""; } else { this.lblMessage.Text = "The Owner has not been saved."; } } }
protected void gvResult_ItemCommand(object source, DataGridCommandEventArgs e) { string vInactive = ((System.Web.UI.WebControls.Button)(e.CommandSource)).Text; if (vInactive == "Delete") { gvResult_DeleteCommand(source, e); } if (vInactive == "Rotation Publications") { string strConfid = ((Label)e.Item.Cells[0].Controls[1]).Text; int confid = Convert.ToInt32(strConfid); string strConfname = ((Label)e.Item.Cells[1].Controls[1]).Text; string strDates = ((Label)e.Item.Cells[2].Controls[1]).Text + " - " + ((Label)e.Item.Cells[3].Controls[1]).Text; gvRotatPubs.DataSource = LU_DAL.DisplayRotationPubs(confid); gvRotatPubs.EmptyDataText = "Sorry, no publications have been selected for " + strConfname; gvRotatPubs.Caption = "<strong>Rotation Publications for " + strConfname + "</strong><br>" + strDates + "<br><br>"; gvRotatPubs.DataBind(); PubEntAdminManager.ExportToExcel(gvRotatPubs, this.Page); //PubEntAdminManager.ExportGridViewToExcel(gvRotatPubs, "RotationPublicationsNew", "<strong>Rotation Publications for " + strConfname + "</strong><br>" + strDates, this.Page.Response); //ExportRoutines.ExportToExcel(this.Page, "RotationPublications", "<strong>Rotation Publications for " + strConfname + "</strong><br>" + strDates, this.gvRotatPubs); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { ReadingLevelCollection dt = ((ReadingLevelCollection)this.gvResult.DataSource); PubEntAdmin.BLL.ReadingLevel l_conf = dt[e.Item.ItemIndex]; int Rdlid = l_conf.RdlID; string Rdlname = l_conf.RdlName; string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean rdlExist = LU_DAL.RdlExist(Rdlid); if (rdlExist == false) { LU_DAL.DeleteReadingLevelLU(Rdlid); Response.Redirect("~/LookupMgmt.aspx?sub=readinglevel"); } else if (rdlExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateReadingLevelLU(Rdlid, Rdlname, Active); Response.Redirect("~/LookupMgmt.aspx?sub=readinglevel"); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { LanguageCollection dt = ((LanguageCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Language l_conf = dt[e.Item.ItemIndex]; int Lngid = l_conf.LngID; string Lngname = l_conf.LngName; string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean lngExist = LU_DAL.LngExist(Lngid); if (lngExist == false) { LU_DAL.DeleteLanguageLU(Lngid); Response.Redirect("~/LookupMgmt.aspx?sub=language"); } else if (lngExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateLanguageLU(Lngid, Lngname, Active); Response.Redirect("~/LookupMgmt.aspx?sub=language"); } }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { OwnerCollection dt = ((OwnerCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Owner l_owner = dt[e.Item.DataSetIndex]; int OwnerID = l_owner.OwnerID; string lname = ((TextBox)e.Item.Cells[1].Controls[1]).Text.Trim(); string fname = ((TextBox)e.Item.Cells[2].Controls[1]).Text.Trim(); string minitial = ((TextBox)e.Item.Cells[3].Controls[1]).Text; bool valid = false; bool validlen = false; if (lname.Length != 0) { valid = PubEntAdminManager.OtherVal(lname); validlen = PubEntAdminManager.LenVal(lname, 20); } if (fname.Length != 0) { valid = PubEntAdminManager.OtherVal(fname); validlen = PubEntAdminManager.LenVal(fname, 20); } if (minitial.Length != 0) { valid = PubEntAdminManager.OtherVal(minitial); validlen = PubEntAdminManager.LenVal(minitial, 1); minitial = minitial.Trim(); } if ((valid == false) && (validlen == true)) { OwnerCollection coll = LU_DAL.GetOwnerByFullname(fname, lname, minitial); if (coll.Count > 0) { string confirm = "The Owner already existed."; ((Label)e.Item.Cells[8].Controls[1]).Text = confirm; } else { LU_DAL.UpdateOwnerLU(OwnerID, fname, lname, minitial); this.gvResult.EditItemIndex = -1; //this.BindDataAferUpdate(); this.BindData(); } } else { Response.Redirect("InvalidInput.aspx"); } }
protected void btn_Find_Click(object sender, EventArgs e) { this.lblSearchSpids.Text = ""; this.lblSearchASpids.Text = ""; if (this.txtFind.Text.Trim() != "") { this.lblSearchSpids.Text = LU_DAL.GetSponsorIDsbyKeyword(this.txtFind.Text, false); if (this.lblSearchSpids.Text == "") { this.pnlResult.Visible = false; this.lblMessage.Text = PubEntAdminManager.strNoSearchResults; } else { this.lblSearchASpids.Text = LU_DAL.GetSponsorIDsbyKeyword(this.txtFind.Text, true); gvResult.CurrentPageIndex = 0; this.BindData(); this.pnlResult.Visible = true; this.gvResult.EditItemIndex = -1; reset(); } } if (this.txtFind.Text.Trim() == "") { gvResult.CurrentPageIndex = 0; this.BindData(); this.pnlResult.Visible = true; this.gvResult.EditItemIndex = -1; reset(); } //lblSearchPubids.Text = this.txtFind.Text; //gvResult.CurrentPageIndex = 0; //this.BindData(); //if (gvResult.Items.Count == 0) //{ // this.pnlResult.Visible = false; // this.lblMessage.Text = PubEntAdminManager.strNoSearchResults; //} //else //{ // this.pnlResult.Visible = true; // this.gvResult.EditItemIndex = -1; // reset(); //} }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { SponsorCollection dt = ((SponsorCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Sponsor l_spon = dt[e.Item.DataSetIndex]; int Sponid = l_spon.SponsorID; //string SpDesc12 = ((TextBox)e.Item.Cells[1].Controls[1]).Text; string SpCode = ((TextBox)e.Item.Cells[1].Controls[1]).Text; string SpLongDesc = ((TextBox)e.Item.Cells[2].Controls[1]).Text; bool valid = false; bool validlen = false; if (SpLongDesc.Length != 0) { string longdesc = txtSpLongDesc.Text; valid = PubEntAdminManager.OtherVal(longdesc); validlen = PubEntAdminManager.LenVal(longdesc, 101); } if (SpCode.Length != 0) { string code = txtSpCode.Text; valid = PubEntAdminManager.OtherVal(code); validlen = PubEntAdminManager.LenVal(code, 7); } if ((valid == false) && (validlen == true)) { SponsorCollection coll = LU_DAL.GetSponsorsbyDesc(SpLongDesc); if (coll.Count > 0) { string confirm = "The Sponsor already existed."; ((Label)e.Item.Cells[7].Controls[1]).Text = confirm; } else { LU_DAL.UpdateSponsorLU(Sponid, SpCode, SpLongDesc, 1); this.gvResult.EditItemIndex = -1; this.BindData(); } } else { Response.Redirect("InvalidInput.aspx"); } }
protected void BindData() { if (lblSearchKeywordOwerids.Text == null || lblSearchKeywordOwerids.Text == "") { this.gvResult.DataSource = LU_DAL.GetAllLuOwners(false); } else { //this.gvResult.DataSource = LU_DAL.GetOwnersbyKeyword(lblSearchPubids.Text.Trim()); this.gvResult.DataSource = LU_DAL.GetOwnersbyOwneridbyKeyword(lblSearchKeywordOwerids.Text.Trim()); } this.gvResult.DataKeyField = "OwnerID"; this.gvResult.DataBind(); }
protected void BindData() { if (lblSearchSpids.Text == null || lblSearchSpids.Text == "") { this.gvResult.DataSource = LU_DAL.GetAllLuSponsors(false); gvExcelRpt.DataSource = LU_DAL.GetAllLuSponsors(true); } else { this.gvResult.DataSource = LU_DAL.GetSponsorsbySponsoridbyKeyword(lblSearchSpids.Text.Trim(), false); gvExcelRpt.DataSource = LU_DAL.GetSponsorsbySponsoridbyKeyword(lblSearchASpids.Text.Trim(), true); } this.gvResult.DataKeyField = "SponsorID"; this.gvResult.DataBind(); gvExcelRpt.DataBind(); }
protected void AddLookup(string awddesc, string awdname, string awdcategory, string awdyear) { string dbAwdname; string dbAwdCate; string dbAwdYear; DataSet ds = new DataSet(); ds = LU_DAL.displayAward(); if (ds.Tables[0].Rows.Count == 0) { LU_DAL.AddAward(awdname, awdyear, awdcategory); Response.Redirect("~/LookupMgmt.aspx?sub=award"); } else { Boolean iExist = false; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dataRow = ds.Tables[0].Rows[i]; dbAwdname = (string)dataRow["AWARD_NAME"].ToString().Trim(); dbAwdCate = (string)dataRow["AWARD_Category"].ToString().Trim(); dbAwdYear = (string)dataRow["AWARD_YEAR"].ToString().Trim(); if (awdname.Trim() == dbAwdname && awdcategory.Trim() == dbAwdCate && awdyear.Trim() == dbAwdYear) { iExist = true; } } if (iExist) { string confirm = "The Lookup value already exists."; Message.Text = confirm; Message.Visible = true; } else { LU_DAL.AddAward(awdname.Trim(), awdyear.Trim(), awdcategory.Trim()); Response.Redirect("~/LookupMgmt.aspx?sub=award"); } } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { AwardCollection dt = ((AwardCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Award l_conf = dt[e.Item.ItemIndex]; int Awdid = l_conf.AwardID; string Awdname = ""; //string AwdCategoryYear = ""; string Awdyear = ""; string Awdcategory = ""; Awdname = l_conf.AwdName; Awdcategory = l_conf.AwdCategory; Awdyear = l_conf.AwdYear; string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean awdExist = LU_DAL.AwdExist(Awdid); if (awdExist == false) { LU_DAL.DeleteAwardLU(Awdid); Response.Redirect("~/LookupMgmt.aspx?sub=award"); } else if (awdExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateAwardLU(Awdid, Awdname.Trim(), Awdyear.Trim(), Awdcategory.Trim(), Active); Response.Redirect("~/LookupMgmt.aspx?sub=award"); } }
protected void BindConferences() { //LiveInt l_liveInt = PE_DAL.GetLiveIntByPubID(this.PubID); //IsExh = l_liveInt.Exhibit == 0 ? false : true; DataSet ds = (DataSet)LU_DAL.GetKioskPub(this.PubID); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { this.pnlkiosk.Visible = true; IsExh = true; } else { IsExh = false; } } }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { LanguageCollection dt = ((LanguageCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Language l_conf = dt[e.Item.ItemIndex]; int Lngid = l_conf.LngID; string Lngname = ((TextBox)e.Item.Cells[1].Controls[1]).Text; int Active = 0; string sActive = ((Label)e.Item.Cells[2].Controls[1]).Text; if (sActive == "Active") { Active = 1; } else { Active = 0; } Boolean valid = false; Boolean validnum = false; Boolean validlen = false; if (Lngname.Length != 0) { valid = PubEntAdminManager.OtherVal(Lngname); validnum = PubEntAdminManager.SpecialVal2(Lngname); validlen = PubEntAdminManager.LenVal(Lngname, 50); } if ((valid == false) && (validnum == false) && (validlen == true)) { LU_DAL.UpdateLanguageLU(Lngid, Lngname, Active); Response.Redirect("~/LookupMgmt.aspx?sub=language"); } else { Response.Redirect("InvalidInput.aspx"); } }
protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e) { SeriesCollection dt = ((SeriesCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Series l_conf = dt[e.Item.ItemIndex]; int Sreid = l_conf.SeriesID; string Srename = l_conf.SeriesName; //string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text; string Activestatus = ((Button)e.Item.Cells[5].Controls[7]).Text; if (Activestatus == "Inactive") { Boolean sreExist = LU_DAL.SreExist(Sreid); if (sreExist == false) { LU_DAL.DeleteSeriesLU(Sreid); Response.Redirect("~/LookupMgmt.aspx?sub=serie"); } else if (sreExist == true) { string confirm = "Unable to Inactivate, value associated with Publication."; //((Label)e.Item.Cells[5].Controls[1]).Text = confirm; //TEST((Label)e.Item.Cells[6].Controls[1]).Text = confirm; ((Label)e.Item.Cells[6].Controls[0]).Text = confirm; } } if (Activestatus == "Active") { int Active = 1; LU_DAL.UpdateSeriesLU(Sreid, Srename, Active); Response.Redirect("~/LookupMgmt.aspx?sub=serie"); } }
protected void AddLookup(string lngdesc) { string lngcode = String.Empty; ArrayList status = new ArrayList(); ArrayList toinsert = new ArrayList(); int flag = 0; Boolean iValue = true; string[] split = null; string[] dbsplit = null; string sLngName = null; string delimStr = " "; char[] delimiter = delimStr.ToCharArray(); sLngName = lngdesc.Trim(); split = sLngName.Split(delimiter); DataSet ds = new DataSet(); ds = LU_DAL.displayLanguage(); string dbValue = ""; //loop through dataset if (ds.Tables[0].Rows.Count == 0) { LU_DAL.AddLanguage(lngdesc, lngcode); Response.Redirect("~/LookupMgmt.aspx?sub=language"); } else { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dataRow = ds.Tables[0].Rows[i]; dbValue = (string)dataRow["DESCRIPTION"]; dbsplit = dbValue.Split(delimiter); status.Clear(); if (dbsplit.Length == split.Length) { //compare each word in the row to words being added for (int j = 0; j < dbsplit.Length; j++) { Boolean s = Object.Equals(dbsplit[j], split[j]); status.Add(s); } flag = 0; //Parse through the status for each word, and if no match update the flag for (int k = 0; k < status.Count; k++) { if (status[k].Equals(true)) { flag = flag + 1; } } //if the flag is equal to number of words, means that there is an exact match if (status.Count == flag) { //set iValue to false and display message iValue = false; } else if (status.Count != flag) { iValue = true; } } //populate all the iValues for the rows in the database in Arraylist toinsert.Add(iValue); } Boolean iFinalinsert = false; int y = 0; int n = 0; //Parse the arrayList for (int m = 0; m < toinsert.Count; m++) { if (toinsert[m].Equals(false)) { //the Value already exits do not insert y = y + 1; } else { n = n + 1; } if (n == toinsert.Count) { iFinalinsert = true; } else { iFinalinsert = false; } //Does not exist in database and therefore insert if ((iFinalinsert == true) && (lngdesc.Length != 0)) { LU_DAL.AddLanguage(lngdesc, lngcode); Response.Redirect("~/LookupMgmt.aspx?sub=language"); } else if (lngdesc.Length == 0) { string confirm = "Cannot add empty Lookup Value."; Message.Text = confirm; Message.Visible = true; } else { string confirm = "The Lookup value already exists."; Message.Text = confirm; Message.Visible = true; } } } }
protected void SetTimoutData(int RotateTime, int PageTime, int SessionTime) { LU_DAL.SetTimeout(RotateTime, PageTime, SessionTime, ((CustomPrincipal)HttpContext.Current.User).UserID); Response.Redirect("Conference.aspx", false); }
protected void UpdateConfData(int Confid, string confname, int maxOrder, DateTime sDate, DateTime eDate) { LU_DAL.UpdateConf(Confid, confname, maxOrder, sDate, eDate); Response.Redirect("Conference.aspx", false); }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { SeriesCollection dt = ((SeriesCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Series l_conf = dt[e.Item.ItemIndex]; int Sreid = l_conf.SreID; string Srename = ((TextBox)e.Item.Cells[1].Controls[1]).Text; int Active = 0; string sActive = ((Label)e.Item.Cells[2].Controls[1]).Text; if (sActive == "Active") { Active = 1; } else { Active = 0; } Boolean valid = false; Boolean validnum = false; Boolean validlen = false; if (Srename.Length != 0) { valid = PubEntAdminManager.OtherVal(Srename); validnum = PubEntAdminManager.SpecialVal2(Srename); validlen = PubEntAdminManager.LenVal(Srename, 50); } if ((valid == false) && (validnum == false) && (validlen == true)) { #region NCIPL_CC_Checks //Added check LiveIntSel LiveIntSel2 = (LiveIntSel)e.Item.Cells[3].Controls[0]; if (!LiveIntSel2.SelectedAny) { Label lblMessage = e.Item.Cells[6].Controls[0] as Label; lblMessage.Text = "At least one Live Interface should be selected."; return; } //Check whether there are associations before removing an Interface if (LiveIntSel2.InNCIPL == false) { bool ValExists = LU_DAL.CheckSeriesInterfaceAssociation(Sreid, "NCIPL"); if (ValExists) { Label lblMessage = e.Item.Cells[6].Controls[0] as Label; //lblMessage.Text = "This Series has associations on the NCIPL tab for one or more publications."; lblMessage.Text = "Unable to Update, value associated with publication(s) on the NCIPL tab."; return; } } if (LiveIntSel2.InROO == false) { bool ValExists = LU_DAL.CheckSeriesInterfaceAssociation(Sreid, "NCIPL_CC"); if (ValExists) { Label lblMessage = e.Item.Cells[6].Controls[0] as Label; //lblMessage.Text = "This Series has associations on the ROO tab for one or more publications."; lblMessage.Text = "Unable to Update, value associated with publication(s) on the NCIPLcc tab."; return; } } #endregion //NCIPL_CC LU_DAL.UpdateSeriesLU(Sreid, Srename, Active); LU_DAL.UpdateSeriesLU(Sreid, Srename, Active, (LiveIntSel2.InNCIPL == true) ? 1 : 0, (LiveIntSel2.InROO == true) ? 1 : 0); Response.Redirect("~/LookupMgmt.aspx?sub=serie"); } else { Response.Redirect("InvalidInput.aspx"); } }
protected void BindData() { this.gvResult.DataSource = LU_DAL.GetCancerTypeLU(); this.gvResult.DataBind(); }
protected void BindData() { this.gvResult.DataSource = LU_DAL.GetAwardLU(); this.gvResult.DataBind(); }
protected void gvResult_ItemDataBound(object sender, DataGridItemEventArgs e) { string sYear = ""; AwardCollection dt = ((AwardCollection)this.gvResult.DataSource); if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { PubEntAdmin.BLL.Award l_conf = dt[e.Item.ItemIndex]; string Awardid = Convert.ToString(l_conf.AwardID); sYear = LU_DAL.GetAwardLUbyAwardid(Awardid); ((Label)e.Item.Cells[1].Controls[1]).Text = Server.HtmlEncode(l_conf.AwardDescription); //delete btn col Button l_able = e.Item.Cells[5].FindControl("lnkbtnDel") as Button; if (l_conf.Checked) { ((Label)e.Item.Cells[2].Controls[1]).Text = "Active"; l_able.Text = "Inactivate"; Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Lookup Value [" + Server.HtmlEncode(l_conf.AwdName) + "]?"; } else { ((Label)e.Item.Cells[2].Controls[1]).Text = "Inactive"; l_able.Text = "Activate"; Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Lookup Value [" + Server.HtmlEncode(l_conf.AwdName) + "]?"; } } else if (e.Item.ItemType == ListItemType.EditItem) { PubEntAdmin.BLL.Award l_conf = dt[e.Item.ItemIndex]; string Awardid = Convert.ToString(l_conf.AwardID); sYear = LU_DAL.GetAwardLUbyAwardid(Awardid); //((TextBox)e.Item.Cells[1].Controls[1]).Text = Server.HtmlEncode(l_conf.AwdName); String status = ""; if (l_conf.Checked == true) { status = "Active"; } else { status = "Inactive"; } ((Label)e.Item.Cells[2].Controls[1]).Text = status; if (e.Item.Cells[3].Controls[2] is Button) { Button l_btnCancel = ((Button)e.Item.Cells[3].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_cancel.ID = "l_cancel"; l_cancel.Text = "Cancel"; 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[3].Controls.Add(l_panel); e.Item.Cells[3].Controls.Add(l_mpe); e.Item.Cells[3].Controls.Add(l_cbe); } //delete btn col Button l_able = e.Item.Cells[5].FindControl("lnkbtnDel") as Button; if (l_conf.Checked) { ((Label)e.Item.Cells[2].Controls[1]).Text = "Active"; l_able.Text = "Inactivate"; Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Lookup Value [" + Server.HtmlEncode(l_conf.AwdName) + "]?"; } else { ((Label)e.Item.Cells[2].Controls[1]).Text = "Inactive"; l_able.Text = "Activate"; Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel; ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Lookup Value [" + Server.HtmlEncode(l_conf.AwdName) + "]?"; } } }
protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e) { AwardCollection dt = ((AwardCollection)this.gvResult.DataSource); PubEntAdmin.BLL.Award l_conf = dt[e.Item.ItemIndex]; int Awdid = l_conf.AwardID; string Awdname = ""; string Awdyear = ""; string Awdcategory = ""; Awdname = ((TextBox)e.Item.Cells[1].Controls[1]).Text; Awdcategory = ((TextBox)e.Item.Cells[1].Controls[3]).Text; Awdyear = ((TextBox)e.Item.Cells[1].Controls[5]).Text; if (Awdyear == "") { string confirm = "Award Year cannot be empty."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } else { int Active = 0; string sActive = ((Label)e.Item.Cells[2].Controls[1]).Text; if (sActive == "Active") { Active = 1; } else { Active = 0; } ((TextBox)e.Item.Cells[1].Controls[1]).Visible = false; Boolean valid = false; Boolean validnum = false; Boolean validlen = true; if (Awdname != null && Awdname.Length != 0) { valid = PubEntAdminManager.OtherVal(Awdname); validnum = PubEntAdminManager.SpecialVal2(Awdname); validlen = PubEntAdminManager.LenVal(Awdname, 50); } if (Awdcategory != null && Awdcategory.Length != 0) { valid = PubEntAdminManager.OtherVal(Awdcategory); validnum = PubEntAdminManager.SpecialVal2(Awdcategory); validlen = PubEntAdminManager.LenVal(Awdcategory, 100); } if (Awdyear != null && Awdyear.Length != 0) { valid = PubEntAdminManager.OtherVal(Awdyear); validnum = PubEntAdminManager.SpecialVal2(Awdyear); validlen = PubEntAdminManager.LenVal(Awdyear, 10); } if ((valid == false) && (validnum == false) && (validlen == true)) { DataSet ds = new DataSet(); ds = LU_DAL.displayAward(); string dbAwdname = ""; string dbAwdCate = ""; string dbAwdYear = ""; Boolean iExist = false; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dataRow = ds.Tables[0].Rows[i]; dbAwdname = (string)dataRow["AWARD_NAME"].ToString().Trim(); dbAwdCate = (string)dataRow["AWARD_Category"].ToString().Trim(); dbAwdYear = (string)dataRow["AWARD_YEAR"].ToString().Trim(); if (Awdname.Trim() == dbAwdname && Awdcategory.Trim() == dbAwdCate && Awdyear.Trim() == dbAwdYear) { iExist = true; } } if (iExist) { e.Item.Cells[1].Controls[1].Visible = true; string confirm = " The Lookup value already exists."; ((Label)e.Item.Cells[5].Controls[1]).Text = confirm; } else { LU_DAL.UpdateAwardLU(Awdid, Awdname, Awdyear, Awdcategory, Active); Response.Redirect("~/LookupMgmt.aspx?sub=award"); } } else { Response.Redirect("InvalidInput.aspx"); } } }
protected void BindData() { this.gvResult.DataSource = LU_DAL.GetLanguageLU(); this.gvResult.DataBind(); }
protected void BindData() { this.gvResult.DataSource = LU_DAL.GetProductFormatLU(); this.gvResult.DataBind(); }