protected void lnkBtnInventoryName_Click(object sender, EventArgs e) { sppopuptitle.InnerText = "Edit Inventory Item"; var hftemp = (HiddenField)grdItemType.Rows[Convert.ToInt32(hfItemTypeID.Value)].FindControl("hfitemtypeid"); Int32 itemtypeid = Convert.ToInt32(hftemp.Value); rbtlstconsumable.SelectedValue = itemtypeid.ToString(); if (rbtlstconsumable.SelectedItem.Text.IndexOf("TestsAssociated") > -1) { Int32 itemid = Convert.ToInt32(grdItemType.DataKeys[Convert.ToInt32(hfItemTypeID.Value)].Value); EInventoryItemTest[] testobj = null; var masterDal = new MasterDAL(); //Mode '1' is used for Getting Inventory Item acc. to InventoryID var listInventoryItemTest = masterDal.GetInventoryItemTestbyInventoryID(itemid.ToString(), 1); if (listInventoryItemTest != null) { testobj = listInventoryItemTest.ToArray(); } for (int icount = 0; icount < chklsttestassociated.Items.Count; icount++) { chklsttestassociated.Items[icount].Selected = false; } for (int count = 0; count < testobj.Length; count++) { for (int icount = 0; icount < chklsttestassociated.Items.Count; icount++) { if (chklsttestassociated.Items[icount].Value == testobj[count].TestID.ToString()) { chklsttestassociated.Items[icount].Selected = true; break; } } } ClientScript.RegisterStartupScript(typeof(string), "jscript", "<script language='javascript' type='text/javascript'> makevisiblediv('true'); </script>"); } else { ClientScript.RegisterStartupScript(typeof(string), "jscript", "<script language='javascript' type='text/javascript'> makevisiblediv('false'); </script>"); } ModalPopupExtender.Show(); }
protected void VendorGrid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("EditVendor")) { string[] data = ((string)e.CommandArgument).Split(':'); _VendorId = AlwaysConvert.ToInt(data[0]); HiddenVendorId.Value = _VendorId.ToString(); _Vendor = VendorDataSource.Load(_VendorId); VendorName.Text = _Vendor.Name; Email.Text = _Vendor.Email; ModalPopupExtender.Show(); EditAjax.Update(); } }
/// <summary> /// Invoke the model POP up for big image /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkPhoto_Click(object sender, EventArgs e) { LinkButton templink = (LinkButton)sender; ContentPlaceHolder item = (ContentPlaceHolder)templink.NamingContainer; Panel1.Style.Add(HtmlTextWriterStyle.Display, "block"); if (((LinkButton)(sender)).CommandName == "MyPhoto") { imgLargeImage.Src = imgmyphto.ImageUrl; } ModalPopupExtender.Show(); }
protected void ddlOffice_SelecttedIndexChanged(object sender, EventArgs e) { try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; int officeId = Convert.ToInt16(ddlOffice.SelectedValue); getDepartmentSetForDropDown(officeId, OCODE); ModalPopupExtender.Show(); } catch (Exception) { throw; } }
/// <summary> /// Displays the dialog on the screen and wait for response from the users /// </summary> public void Show() { if (OnShow != null) { OnShow(); } ModalPopupExtender.Show(); // need to refresh to ensure that dialog is visible. RefreshUI(); State = ShowState.Show; }
protected void ddlSection_SelecttedIndexChanged(object sender, EventArgs e) { try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; int sectionId = Convert.ToInt16(ddlSection.SelectedValue); SetSubSctionForDropdown(sectionId, OCODE); ModalPopupExtender.Show(); } catch (Exception) { throw; } }
protected void btnEnviarNewPass_Click(object sender, EventArgs e) { if ((TxtPassNuevo.Text == TxtPassNew.Text) && (TxtPassNuevo.Text != "" && TxtPassNew.Text != "")) { Usuario ocambiopsw = new Usuario(); string Key; Key = ConfigurationManager.AppSettings["TamperProofKey"]; EUsuario oecambiopasw = ocambiopsw.cambiarContrasena(TxtSolicitante.Text, Encriptacion.Codificar(TxtPassNew.Text, Key), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now)); EntrySeccion oSeccion = new EntrySeccion(); EEntrySeccion oeseccion = oSeccion.Register_PrimerSeccion(Convert.ToString(this.Session["sUser"]), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now)); limpiarcontroles(); FAdmin.Get_Delete_Sesion_User(this.Session["sUser"].ToString().Trim()); //realiza el envio de Email confirmatorio del cambio de clave Enviomail oEnviomail = new Enviomail(); EEnviomail oeEmail = oEnviomail.Envio_mails(this.Session["scountry"].ToString().Trim(), "Solicitud_Clave"); Mails oMail = new Mails(); oMail.Credenciales = true; oMail.Puerto = Convert.ToInt32(ConfigurationManager.AppSettings["Puerto"]); //Se agrega Puerto Ing. CarlosH 30/11/2011 oMail.Server = oeEmail.MailServer; oMail.MCifrado = true; //Se agrega Cifrado Ing. CarlosH 30/11/2011 oMail.DatosUsuario = new System.Net.NetworkCredential(); //Se agrega Credenciales Ing. CarlosH 30/11/2011 oMail.From = oeEmail.MailFrom; oMail.To = this.Session["smail"].ToString().Trim(); oMail.BCC = "*****@*****.**"; oMail.Subject = "Acuse de Cambio de Clave" + "' '" + "Usuario" + "' '" + this.Session["sUser"].ToString().Trim(); string[] textArray1 = new string[] { "Señor usuario:" + ' ' + "Su Clave se ha modificado Correctamente", "<br><br>", "Atentamente", "<br>", "Administrador Xplora", }; oMail.Body = string.Concat(textArray1); oMail.BodyFormat = "HTML"; oMail.send(); oMail = null; oeEmail = null; oEnviomail = null; this.Session["mensaje"] = "Su clave ha sido cambiada correctamente ver confirmación en su correo"; this.Session["cssclass"] = "MensajesSupConfirm"; PMensajeClave.CssClass = this.Session["cssclass"].ToString(); lblpasw.Text = this.Session["mensaje"].ToString(); ModalPopupExtender.Show(); } else { } }
public void ShowEditText(object sender, CommandEventArgs e) { ViewState["ResID"] = e.CommandArgument.ToString(); ModalPopupExtender modalPopupExtender = (ModalPopupExtender)Page.FindControlRecursive("EditTextPopup"); modalPopupExtender.Show(); Model1 _db = new Model1(); int id = int.Parse(ViewState["ResID"].ToString()); resources res = (from resources in _db.resources where resources.ResourceID == id select resources).FirstOrDefault(); TextBox text = (TextBox)Page.FindControlRecursive("editTextResource"); text.Text = res.ResourcePath; }
public void ShowEditBlock(object sender, CommandEventArgs e) { ModalPopupExtender popup = (ModalPopupExtender)Page.FindControlRecursive("EditBlockPopup"); popup.Show(); TextBox blockName = (TextBox)Page.FindControlRecursive("EditBlockName"); Model1 _db = new Model1(); ViewState["BlockID"] = e.CommandArgument.ToString(); int id = int.Parse(ViewState["BlockID"].ToString()); blocks b = (from blocks in _db.blocks where blocks.BlockID == id select blocks).FirstOrDefault(); blockName.Text = b.BlockName; }
protected void SaveMovie_ServerClick(object sender, EventArgs e) { ValidateNull(); movie.genero = movieGender.Value; movie.rango_fechas = fromDay.Value + "/" + fromYear.Value + " - " + ToDay.Value + "/" + toYear.Value; if (movieBusiness.updateMovie(movie)) { Response.Redirect("MovieAdministration.aspx"); } else { resultMessage.InnerText = "Ha ocurrido un error. Por favor intentelo más tarde."; ModalPopupExtender.Show(); } }
protected void UploadImage_ServerClick(object sender, EventArgs e) { if (!ImageUploader.HasFile) { resultMessage.InnerText = "Debe buscar una imagen!"; ModalPopupExtender.Show(); } else { HttpPostedFile file = ImageUploader.PostedFile; Session["IMAGE"] = file; file.SaveAs(Server.MapPath(@"MenuImages/" + file.FileName)); uploadImageUser.Attributes.Add("data-src", "MenuImages/" + file.FileName); } }
protected void RadGrid_parametros_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { RadComboBox cmb_periodo = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_periodo") as RadComboBox; RadComboBox cmb_año = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_año") as RadComboBox; RadComboBox cmb_mes = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_mes") as RadComboBox; RadComboBox cmb_cadena = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cadena") as RadComboBox; RadComboBox cmb_ciudad = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_ciudad") as RadComboBox; RadComboBox cmb_cobertura = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cobertura") as RadComboBox; UpdatePanel up_filtros = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("up_filtros") as UpdatePanel; ModalPopupExtender mpe_ver = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("mpe_ver") as ModalPopupExtender; iidcompany = Convert.ToInt32(this.Session["companyid"].ToString()); sidcanal = this.Session["Canal"].ToString(); if (e.CommandName == "BUSCAR") { Label lbl_id_año = (Label)e.Item.FindControl("lbl_id_año"); Label lbl_id_mes = (Label)e.Item.FindControl("lbl_id_mes"); Label lbl_id_periodo = (Label)e.Item.FindControl("lbl_id_periodo"); Label lbl_id_tipoCiudad = (Label)e.Item.FindControl("lbl_id_tipoCiudad"); Label lbl_id_oficina = (Label)e.Item.FindControl("lbl_id_oficina"); Label lbl_id_cadena = (Label)e.Item.FindControl("lbl_id_cadena"); ImageButton imgBtn_buscar = (ImageButton)e.Item.FindControl("btn_img_buscar"); cmb_año.SelectedIndex = cmb_año.Items.FindItemIndexByValue(lbl_id_año.Text); cmb_mes.SelectedIndex = cmb_mes.Items.FindItemIndexByValue(lbl_id_mes.Text); cargarPeriodo(); cmb_periodo.SelectedIndex = cmb_periodo.Items.FindItemIndexByValue(lbl_id_periodo.Text); cmb_cobertura.SelectedIndex = cmb_cobertura.Items.FindItemIndexByValue(lbl_id_tipoCiudad.Text); cmb_ciudad.SelectedIndex = cmb_ciudad.Items.FindItemIndexByValue(lbl_id_oficina.Text); cmb_cadena.SelectedIndex = cmb_cadena.Items.FindItemIndexByValue(lbl_id_cadena.Text); up_filtros.Update(); } if (e.CommandName == "ELIMINAR") { Label lbl_id = (Label)e.Item.FindControl("lbl_id"); string path = Server.MapPath("~/parametros.xml"); Reportes_parametros oReportes_parametros = new Reportes_parametros(); oReportes_parametros.Id = Convert.ToInt32(lbl_id.Text); Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml(); oReportes_parametrosToXml.DeleteElement(oReportes_parametros, path); cargarParametrosdeXml(); mpe_ver.Show(); } }
public void ShowSubjectPanel(object sender, EventArgs e) { ModalPopupExtender modalPopupExtender = (ModalPopupExtender)Page.FindControlRecursive("EditSubjectPopup"); modalPopupExtender.Show(); TextBox name = (TextBox)Page.FindControlRecursive("EditSubjectName"); using (Model1 _db = new Model1()) { Models.subjects sub = (from subjects in _db.subjects where subjects.SubjectID == subjectID select subjects).FirstOrDefault(); name.Text = sub.SubjectName; updatePanel.Update(); } }
protected void SaveProduct_ServerClick(object sender, EventArgs e) { if (productName.Value != null && productDescription.Value != null && price.Value != null && amount.Value != null && fileToSave != null) { Catalogue product = new Catalogue(productName.Value, productDescription.Value, Convert.ToInt32(price.Value), Convert.ToInt32(amount.Value), "MenuImages/" + fileToSave.FileName); resultMessage.InnerText = menuService.AddNewProductToMenuService(product); ClearSpaces(); ModalPopupExtender.Show(); Response.Redirect("MenuAdministration.aspx"); } else { resultMessage.InnerText = "Debe llenar todos los campos requeridos."; ModalPopupExtender.Show(); } }
protected void ibInfo_Click(object sender, EventArgs e) { try { ImageButton ib = (ImageButton)sender; Session["modalshowing"] = "true"; ModalPopupExtender mpeInfo = (ModalPopupExtender)ib.NamingContainer.FindControl("mpeInfo"); mpeInfo.Show(); } catch (Exception ex) { throw; //EventLog.WriteEntry("WinkAtHome.Shortcuts.ibInfo_Click", ex.Message, EventLogEntryType.Error); } }
// 4 nov bp added protected void lbtncancel_Click(object sender, EventArgs e) { GridViewRow gvr = (sender as LinkButton).NamingContainer as GridViewRow; LinkButton lblPOnumber = gvr.FindControl("lblPOnumber") as LinkButton; LinkButton lblSalesorder = gvr.FindControl("lblSalesorder") as LinkButton; LinkButton lblIndentNo = gvr.FindControl("lblIndentNo") as LinkButton; LinkButton lbtncancel = gvr.FindControl("lbtncancel") as LinkButton; Label lblorderdate = gvr.FindControl("lblorderdate") as Label; ModalPopupExtender mpas = gvr.FindControl("mpas") as ModalPopupExtender; hd1.Text = lblIndentNo.Text; hd2.Text = lblSalesorder.Text; hd3.Text = lblPOnumber.Text; lblinddate.Text = lblorderdate.Text; mpas.Show(); }
protected void SavePreOrderProduct_ServerClick(object sender, EventArgs e) { if (productName.Value != null && priceProduct.Value != null && creationDateProduct.Value != null && finishDateProduct.Value != null && productDescription.Value != null && fileToSave != null) { PreOrderProduct product = new PreOrderProduct(productName.Value, productDescription.Value, Convert.ToInt32(priceProduct.Value), "MenuImages/" + fileToSave.FileName, creationDateProduct.Value, finishDateProduct.Value); resultMessage.InnerText = preorderBusiness.addPreOrderProductService(product); clearSpaces(); ModalPopupExtender.Show(); Response.Redirect("PreorderAdministration.aspx"); } else { resultMessage.InnerText = "Debe llenar todos los campos requeridos."; ModalPopupExtender.Show(); } }
protected void lbtncancel_Click(object sender, EventArgs e) { try { LinkButton lbtncancel = sender as LinkButton; GridViewRow gvr = lbtncancel.NamingContainer as GridViewRow; ModalPopupExtender mpas = gvr.FindControl("mpas") as ModalPopupExtender; LblActivity.Text = lbtncancel.CommandName; Label lbl = gvr.FindControl("lblcomplaintNo") as Label; ViewState["complaintNo"] = lbl.Text; btnCancel.CommandArgument = lbtncancel.CommandArgument; mpas.Show(); } catch (Exception ex) { } }
protected void BtnLogin_Click(object sender, EventArgs e) { string username = username_txt.Value; string password = password_txt.Value; if (us.Login(username, password)) { Session["USER"] = username; Session["PASS"] = password; Response.Redirect("Panel.aspx"); } else { messageLogin.InnerText = "El usuario o la contraseña son incorrectos."; ModalPopupExtender.Show(); } }
protected void btnWishlist_Click(object sender, EventArgs e) { bool loginStatus = (System.Web.HttpContext.Current.User != null) && System.Web.HttpContext.Current.User.Identity.IsAuthenticated; if (loginStatus) { GalleryEntities1 _db = new GalleryEntities1(); int productID = Convert.ToInt32(Request.QueryString["ProductID"]); Guid userId = (Guid)Membership.GetUser().ProviderUserKey; var existingItem = from w in _db.WISHLISTs where w.ProductId == productID && w.UserId == userId select w; if (existingItem.Any()) { successAdd.Style["display"] = "none"; failedAdd.Style["display"] = "block"; System.Diagnostics.Debug.WriteLine("exist"); } else { WISHLIST item = new WISHLIST(); item.ProductId = productID; item.UserId = userId; if (ModelState.IsValid) { // Save changes here _db.WISHLISTs.Add(item); _db.SaveChanges(); successAdd.Style["display"] = "block"; failedAdd.Style["display"] = "none"; } System.Diagnostics.Debug.WriteLine("not exist"); } } else { MasterPage masterPage = this.Master as MasterPage; ModalPopupExtender ModalPopupExtender1 = (ModalPopupExtender)masterPage.FindControl("ModalPopupExtender1"); ModalPopupExtender1.Show(); } }
protected void roomTypesList_RowCommand(object sender, GridViewCommandEventArgs e) { int RoomTypeId = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "DefaultImageClick") { GridViewRow row = (GridViewRow)(((Control)e.CommandSource).NamingContainer); ModalPopupExtender mpe = (ModalPopupExtender)row.FindControl("ModalPopupExtender1"); mpe.Show(); } if (e.CommandName == "BookNow") { SetSearchCriteria(); Response.Redirect("reservation.aspx", true); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { LabMsg1.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox5.Enabled = true; if (e.CommandName == "ManaDeploy") { string[] seq = e.CommandArgument.ToString().Split(','); DataTable mana = Casetek.KPI.AssessSupervisorDeployMana.QueryMana(seq[0], seq[1], seq[2]); ModalPopupExtender.Show(); TextBox1.Text = mana.Rows[0]["ManagerID"].ToString(); TextBox2.Text = mana.Rows[0]["ManagerName"].ToString(); TextBox3.Text = mana.Rows[0]["DeptID"].ToString(); TextBox4.Text = mana.Rows[0]["DeptName"].ToString(); } }
public void ShowModal(WACFormControl form, bool show) { ModalPopupExtender mpe = WACGlobal_Methods.FindControl <ModalPopupExtender>(form); if (mpe != null) { if (show) { mpe.Show(); ModalDisplayed = true; } else { mpe.Hide(); ModalDisplayed = false; } } }
protected void btnSeparationImageEidt_Click(object sender, EventArgs e) { try { ImageButton imgbtn = (ImageButton)sender; GridViewRow row = (GridViewRow)imgbtn.NamingContainer; Label lblEid = (Label)GridviewSeparation.Rows[row.RowIndex].FindControl("lblEmployeeIdId"); string EID = Convert.ToString(lblEid.Text); hidEid.Value = EID; ModalPopupExtender.Show(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
protected void loginBtn_ServerClick(object sender, EventArgs e) { string user = usernameTxt.Value; string pass = passwordTxt.Value; Administrator admin = new Administrator(user, pass); if (administratorBusiness.LoginService(admin)) { Session["USER"] = user; Session["PASS"] = pass; Response.Redirect("AdministrationPanel.aspx"); } else { messageLogin.InnerText = "El usuario o la contraseña son incorrectos."; ModalPopupExtender.Show(); } }
protected void imgClick_Click(object sender, EventArgs e) { LinkButton templink = (LinkButton)sender; DataListItem item = (DataListItem)templink.NamingContainer; HtmlImage tempimage = (HtmlImage)item.FindControl("image1"); //tempimage.Width = Convert.ToInt16(Panel1.Width.Value - 20); //tempimage.Height = Convert.ToInt16(Panel1.Height.Value - 20); Panel1.Style.Add(HtmlTextWriterStyle.Display, "block"); imgLargeImage.Src = tempimage.Src; //Panel1.Controls.Add(new LiteralControl("<img src='" + tempimage.Src + "' style='width:470px; height:250px; float:left;'/>")); //Panel1..BackImageUrl = tempimage.Src; ModalPopupExtender.Show(); ModalPopupExtender1.Show(); /* code for assigning image url to the image ctrl in panel */ }
protected void buttonGuardar_Click(object sender, EventArgs e) { RadComboBox cmb_periodo = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_periodo") as RadComboBox; RadComboBox cmb_año = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_año") as RadComboBox; RadComboBox cmb_mes = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_mes") as RadComboBox; RadComboBox cmb_cadena = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cadena") as RadComboBox; RadComboBox cmb_ciudad = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_ciudad") as RadComboBox; RadComboBox cmb_cobertura = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cobertura") as RadComboBox; TextBox txt_descripcion_parametros = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("txt_descripcion_parametros") as TextBox; ModalPopupExtender mpe_ver = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("mpe_ver") as ModalPopupExtender; string path = Server.MapPath("~/parametros.xml"); Reportes_parametros oReportes_parametros = new Reportes_parametros(); oReportes_parametros.Id_reporte = Convert.ToInt32(this.Session["Reporte"]); oReportes_parametros.Id_user = this.Session["sUser"].ToString(); oReportes_parametros.Id_compañia = Convert.ToInt32(this.Session["companyid"]); oReportes_parametros.Id_servicio = Convert.ToInt32(this.Session["Service"]); oReportes_parametros.Id_canal = this.Session["Canal"].ToString().Trim(); oReportes_parametros.Id_TipoCiudad = Convert.ToInt32(cmb_cobertura.SelectedValue); oReportes_parametros.Id_oficina = Convert.ToInt32(cmb_ciudad.SelectedValue); oReportes_parametros.Icadena = (cmb_cadena.SelectedValue == "") ? 0 : Convert.ToInt32(cmb_cadena.SelectedValue); oReportes_parametros.Id_año = cmb_año.SelectedValue; oReportes_parametros.Id_mes = cmb_mes.SelectedValue; oReportes_parametros.Id_periodo = Convert.ToInt32(cmb_periodo.SelectedValue); oReportes_parametros.Descripcion = txt_descripcion_parametros.Text.Trim(); oReportes_parametros.Id_tipoReporte = this.Request.Path; Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml(); if (!System.IO.File.Exists(path)) { oReportes_parametrosToXml.createXml(oReportes_parametros, path); } else { oReportes_parametrosToXml.addToXml(oReportes_parametros, path); } cargarParametrosdeXml(); mpe_ver.Show(); }
/// <summary> /// Handle the PreRender event /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { //Check to see if we have a result value. If so, then show it in the confirm dialog box. if (!string.IsNullOrEmpty(m_SubmitDialog.ResultText)) { m_ResultLabel.Text = m_SubmitDialog.ResultText; m_SubmitDialog.ResultText = string.Empty; m_SubmitDialog.ClearViewState(); m_ResultDialog.Style["Display"] = "Inline"; m_ResultPopup.Show(); } else { m_ResultDialog.Style["Display"] = "None"; m_ResultPopup.Hide(); } base.OnPreRender(e); }
protected void TodaysMovieRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.Equals("Book")) { if (Session["USER"] != null) { HiddenField id = (HiddenField)e.Item.FindControl("movieID"); Response.Redirect("Projection.aspx?value=" + id.Value); } else { ModalPopupExtender popUp = (ModalPopupExtender)e.Item.FindControl("ModalPopupExtender1"); message.InnerText = "Para poder acceder a la compra de tiquetes debe autenticarse. Si aun no lo ha hecho puede hacerlo "; link.Attributes.Add("href", "Login.aspx"); link.InnerText = "aqui."; popUp.Show(); } } }
protected void btnWrite_Click(object sender, EventArgs e) { string strsql = "Select * from Finger_Template where IsDeleted = 'false' and CardIssue= 'false' and EmployeeCD = '" + txtEmpCd.Text + "'"; SqlDataAdapter da = new SqlDataAdapter(strsql, AccessController.m_connecton); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 0) { string someScript = ""; string Message = ""; Message = "Can not write on card,employee not enrolled or card is already issued."; someScript = "<script language='javascript'>alert('" + Message + "');</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", someScript); return; } else { //ModalPopupExtender.Show(); if (Session["MasterKey"] == null) { ModalPopupExtender.Show(); } else { ModalPopupExtender.Hide(); if (IsConfirmNeeded) { StringBuilder javaScript = new StringBuilder(); string scriptKey = "ConfirmationScript"; javaScript.AppendFormat("var userConfirmation = window.confirm('{0}');\n", ConfirmMessage); javaScript.Append("__doPostBack('UserConfirmationPostBack', userConfirmation);\n"); ClientScript.RegisterStartupScript(GetType(), scriptKey, javaScript.ToString(), true); } } } }