public SizeGuidePO(IWebDriver driver) { this.driver = driver; wait = new TestWait(this.driver); actions = new ActionsHelper(this.driver); selectHelper = new SelectHelper(); listHelper = new ListHelper(); tableHelper = new TableHelper(); strHelper = new StringHelper(); convertHelper = new ConvertHelper(); executeJScript = new JavaScriptHelper(this.driver); element = new ElementHelper(this.driver); bySizeGuideContent = By.Id("sizeGuideContent"); byChartTable = By.CssSelector("table[data-tstid=charttable"); bySizeGuideDropdown = By.CssSelector("div[data-tstid=sizeguide-scalesdropdown]"); bySizeGuideDropdownSelect = By.XPath("//div[@data-tstid='sizeguide-scalesdropdown']/preceding-sibling::select"); byBrandName = By.Id("productInfo-brand"); byProductDescription = By.Id("productInfo-description"); bySizeTable = By.CssSelector("table[data-tstid=charttable"); byOutOfStockDiv = By.CssSelector("td[data-tstid=outOfStockRow]"); byOutOfStockText = By.XPath("//div[contains(text(), 'Esgotado')]"); byOutOfStockNotifyAvailable = By.CssSelector("button[data-tstid=nibis]"); byAddToBagRow = By.CssSelector("td[data-tstid=addToBagRow]"); byAddToBagPrice = By.XPath("//td[@data-tstid='addToBagRow']//span"); byAddToBagButton = By.CssSelector("button[data-tstid=addToBag]"); byDivDiffPrices = By.XPath("//td[@data-tstid='addToBagRow']/div/div"); byDiffPriceSpan = By.XPath("//td[@data-tstid='addToBagRow']//span[contains(text(), 'Preço diferente')]"); byDiffPriceWhy = By.CssSelector("button[data-tstid=findOutWhy]"); byDiffPriceWhyInfo = By.CssSelector("button[data-tstid=findOutWhy]+div>p"); }
protected void btnEliminar_Click(object sender, EventArgs e) { UsuarioBE oUsuario = new UsuarioBE(); PerfilBL oPerfilBL = new PerfilBL(); oPerfilBL.ErrorEvent += new PerfilBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent); try { oUsuario.NID_PERFIL = Int32.Parse(this.txhPerfilUsuarioID.Value); oUsuario.CO_USUARIO_CAMBIO = Profile.Usuario.CUSR_ID; oUsuario.NO_ESTACION_RED = Profile.Estacion; oUsuario.NO_USUARIO_RED = Profile.UsuarioRed; (Master as Seguridad).onError = false; if (oPerfilBL.EliminarUsuariosRelacionados(oUsuario) > 0 && !(Master as Seguridad).onError) { InicializaPerfilUsuario(); JavaScriptHelper.Alert(this, Message.keyElimino, String.Empty); } else { JavaScriptHelper.Alert(this, Message.keyNoElimino, String.Empty); } } catch (Exception ex) { JavaScriptHelper.Alert(this, Message.keyNoElimino, String.Empty); (Master as Seguridad).Web_ErrorEvent(this, ex); } this.txhPerfilUsuarioID.Value = String.Empty; }
/// <summary> /// 按钮事件:提交信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { //验证重复 if (id <= 0 && DB.getDataTable("select * from FenLei where FenLeiName='" + FenLeiName.Text.Trim() + "'").Rows.Count > 0) { JavaScriptHelper.Error(this, "已存在"); return; } StringBuilder strSql = new StringBuilder(); if (id <= 0)//添加 { strSql.Append("insert into FenLei("); strSql.Append("FenLeiName"); strSql.Append(") values ("); strSql.Append("'" + FenLeiName.Text + "'"); strSql.Append(") "); } else//修改 { strSql.Append("update FenLei set "); strSql.Append(" FenLeiName = '" + FenLeiName.Text.Trim() + "'"); strSql.Append(" where Id= " + id); } DB.ExecuteSql(strSql.ToString()); JavaScriptHelper.Success(this, "保存成功", "FenLeiManage.aspx"); }
private void ValidaHorarioAcceso() { try { if (!RangoFechasValido(this.Profile.Usuario.SFE_INICIO_ACCESO_PERFIL, this.Profile.Usuario.SFE_FIN_ACCESO_PERFIL)) { JavaScriptHelper.Funcion(this.Page, "fc_FechasAccesoPerfilCaducado", "", String.Empty); } else if (!RangoHorasValido(this.Profile.Usuario.HR_INICIO_ACCESO_PERFIL, this.Profile.Usuario.HR_FIN_ACCESO_PERFIL)) { JavaScriptHelper.Funcion(this.Page, "fc_HorarioAccesoPerfilCaducado", "", String.Empty); } else if (!RangoFechasValido(this.Profile.Usuario.SFE_INICIO_ACCESO, this.Profile.Usuario.SFE_FIN_ACCESO)) { JavaScriptHelper.Funcion(this.Page, "fc_FechasAccesoUsuarioCaducado", "", String.Empty); } else if (!RangoHorasValido(this.Profile.Usuario.HR_INICIO_ACCESO, this.Profile.Usuario.HR_FIN_ACCESO)) { JavaScriptHelper.Funcion(this.Page, "fc_HorarioAccesoUsuarioCaducado", "", String.Empty); } } catch (Exception ex) { Web_ErrorEvent(this, ex); } }
private static async Task <string> DecodeResponse(IHtmlDocument htmlDocument, HttpClient httpClient, HttpResponseMessage httpResponseMessage) { string responseString = await httpResponseMessage.Content.ReadAsStringAsync(); string responseJson = string.Empty; if (responseString.StartsWith("{")) { responseJson = responseString; } else { if (JintEngine == null) { IHtmlScriptElement appJsScript = htmlDocument.Scripts.FirstOrDefault(s => s.Source?.Contains("app.js") == true || s.Source?.Contains("app.min.js") == true); string appJsSource = await httpClient.GetStringAsync(appJsScript.Source); List <JavaScriptHelper.Function> functions = JavaScriptHelper.Parse(appJsSource); JavaScriptHelper.Function readFunction = functions.FirstOrDefault(f => f.Name == "read"); JintEngine = new Engine(); JintEngine.Execute(readFunction.Body); } JsValue jsValue = JintEngine.Invoke("read", responseString); responseJson = Encoding.UTF8.GetString(Convert.FromBase64String(jsValue.ToString())); } return(responseJson); }
/// <summary> /// 收藏博客 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button2_Click(object sender, EventArgs e) { if (Request.Cookies["memberinfo"] != null) { string memberid = Server.UrlDecode(Request.Cookies["memberinfo"]["MemberId"]); string content = ""; if (DB.getDataTable("select * from guanzhu where memberid=" + memberid + " and picid=" + id).Rows.Count > 0) { Common.ShowMessage(this.Page, "您之前已经收藏过了!", "", Request.Url.AbsoluteUri); return; } else { content = "<a href=\"bloginfo.aspx?id=" + id + "\" target=\"_blank\">" + BlogName.Text + "</a>"; } DB.ExecuteSql("insert into guanzhu values('" + memberid + "','" + content + "','" + id + "',getdate())"); Common.ShowMessage(this.Page, "收藏成功!", "", Request.Url.AbsoluteUri); } else { JavaScriptHelper.AlertAndRedirect("请先登录。", "userlogin.aspx"); return; } }
protected void btnBuscar_Click(object sender, ImageClickEventArgs e) { DestinoBL oDestinoBL = new DestinoBL(); oDestinoBL.ErrorEvent += new DestinoBL.ErrorDelegate(Master.Transaction_ErrorEvent); txhIdDestinos.Value = String.Empty; String codTipoUbicacion = cboTipoDestino.SelectedValue.ToString(); String ruc = this.txtRuc.Text; String ubicacion = this.txtDescripcion.Text; String codEstado = this.ComboEstado1.SelectedValue.ToString(); //METODO DE CARGA DE PARAMETROS DestinoBE oDestinoBE = new DestinoBE(); oDestinoBE.Tipo_ubicacion = codTipoUbicacion; oDestinoBE.Nro_ruc = ruc; oDestinoBE.Nom_ubicacion = ubicacion; oDestinoBE.Cod_estado = codEstado; oDestinoBEList = oDestinoBL.Listar(oDestinoBE); if (oDestinoBEList == null || oDestinoBEList.Count == 0) { JavaScriptHelper.Alert(this, Message.keyNoRegistros, ""); oDestinoBEList.Add(new DestinoBE()); GuardaParametros("0"); } else { GuardaParametros("1"); } this.grwDestino.DataSource = oDestinoBEList; this.grwDestino.DataBind(); ViewState["oDestinoBEList"] = oDestinoBEList; }
//计算全部在下面 protected void Button_Calculate_Click(object sender, EventArgs e) { LiveData_BLL liveBll = new LiveData_BLL(); DateTime startTime = DateTime.Parse(DropDownList_Year.SelectedItem.Value + "-" + DropDownList_Month.SelectedItem.Value + "-01"); DateTime endTime = startTime.AddMonths(1); if (liveBll.DataCheck(startTime, DropDownList_YBTime.SelectedItem.Value)) { JavaScriptHelper.Loading("大人请稍后,奴才正在拼命计算..."); Score_Day_BLL bll = new Score_Day_BLL(); if (DropDownList_YBTime.SelectedItem.Value == "08时") { bll.Caculate08_ByYbUser(startTime, endTime); } else { bll.Caculate20_ByYbUser(startTime, endTime); } JavaScriptHelper.UnLoading(); Response.Write("<script language=javascript defer>alert('计算完成!');</script>"); } else { Response.Write("<script language=javascript defer>alert('抱歉,该月实况数据不完整,请校验!');</script>"); } }
protected void btnBuscarMarca_Click(object sender, ImageClickEventArgs e) { MarcaBL oMarcaBL = new MarcaBL(); oMarcaBL.ErrorEvent += new MarcaBL.ErrorDelegate(Master.Transaction_ErrorEvent); String nomMarca = this.txtNomMarca.Text; String codEstado = this.cboEstadoMarca.SelectedValue; oMarcaBEList = oMarcaBL.GetAll(nomMarca, codEstado); if (oMarcaBEList == null || oMarcaBEList.Count == 0) { JavaScriptHelper.Alert(this, Message.keyNoRegistros, ""); if (oMarcaBEList == null) { oMarcaBEList = new MarcaBEList(); } oMarcaBEList.Add(new MarcaBE()); GuardaParametros(0); } else { GuardaParametros(1); } this.gvMarca.DataSource = oMarcaBEList; this.gvMarca.DataBind(); ViewState["oMarcaBEList"] = oMarcaBEList; this.txhIdMarca.Value = String.Empty; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Cookies["memberinfo"] != null) { string username = Server.UrlDecode(Request.Cookies["memberinfo"]["UserName"]); DataTable dt = DB.getDataTable("select * from member where username='******'"); if (dt.Rows.Count > 0) { txtUserName.Enabled = false; txtUserName.Text = dt.Rows[0]["username"].ToString(); txtUserPwd.Text = dt.Rows[0]["userpwd"].ToString(); txtTitle.Text = dt.Rows[0]["membername"].ToString(); ltlRegTime.Text = Convert.ToDateTime(dt.Rows[0]["addtime"]).ToString("yyyy-MM-dd HH:mm:ss"); tel.Text = dt.Rows[0]["tel"].ToString(); } } else { JavaScriptHelper.AlertAndRedirect("请先登录。", "userlogin.aspx"); return; } } }
protected void btnGrabarPerfil_OnClick(object sender, EventArgs e) { Int32 retorno; SeguridadBL oSeguridadBL = new SeguridadBL(); oSeguridadBL.ErrorEvent += new SeguridadBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent); try { String cadena = String.Empty; String[] arrCodigos; arrCodigos = this.txhCodOpciones.Value.Trim().Split('|'); /*Insertamos detalle de opciones por perfil*/ String XML = Global.ObtenerXml(this.txhCodOpciones.Value.Trim(), this.txhIndOpciones.Value.Trim()); retorno = oSeguridadBL.InsertUsuarioOpcion(this.usuarioID, XML, Profile.Usuario.CUSR_ID, Profile.Estacion, Profile.UsuarioRed); if (retorno > 0) { CargaOpcionesModulo(); JavaScriptHelper.Alert(this, Message.keyGrabar, String.Empty); } else { JavaScriptHelper.Alert(this, Message.keyErrorGrabar, String.Empty); } } catch { } }
protected void btnActivar_Click(object sender, ImageClickEventArgs e) { UsuarioBL oUsuarioBL = new UsuarioBL(); UsuarioBE oUsuarioBE = new UsuarioBE(); oUsuarioBL.ErrorEvent += new UsuarioBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent); Int32 retorno = 0, contador; String cadNidPuntoVenta = this.txhCadenaSelNum.Value.Trim(); String[] arrCodigos = this.txhCadenaSelNum.Value.Trim().Split('|'); contador = arrCodigos.Length - 2; oUsuarioBE.CO_USUARIO_CREA = Profile.Usuario.CUSR_ID; oUsuarioBE.NO_ESTACION_RED = Profile.Estacion; oUsuarioBE.NO_USUARIO_RED = Profile.UsuarioRed; retorno = oUsuarioBL.ActivarUsuarioMasivo(oUsuarioBE, cadNidPuntoVenta, contador); if (retorno > 0) { JavaScriptHelper.Alert(this, Message.keyActivo, String.Empty); btnBuscar_Click(null, null); this.txhUsuarioID.Value = String.Empty; } else { JavaScriptHelper.Alert(this, Message.keyNoElimino, String.Empty); this.txhUsuarioID.Value = String.Empty; } }
protected void btnEliminar_Click(object sender, ImageClickEventArgs e) { PerfilBL oPerfilBL = new PerfilBL(); PerfilBE oPerfilBE = new PerfilBE(); oPerfilBL.ErrorEvent += new PerfilBL.ErrorDelegate(Master.Transaction_ErrorEvent); oPerfilBE.NID_PERFIL = Int32.Parse(this.txhPerfilID.Value.Trim()); oPerfilBE.CCOAPL = Profile.Aplicacion; oPerfilBE.CO_USUARIO_CAMBIO = Profile.Usuario.CUSR_ID; oPerfilBE.NO_ESTACION_RED = Profile.Estacion; oPerfilBE.NO_USUARIO_RED = Profile.UsuarioRed; Int32 retorno = oPerfilBL.EliminarPerfil(oPerfilBE); if (retorno == 1) { JavaScriptHelper.Alert(this, Message.keyElimino, ""); btnBuscar_Click(null, null); this.txhPerfilID.Value = String.Empty; } else if (retorno == 0) { JavaScriptHelper.Alert(this, Message.keyPefilEnUso, ""); this.txhPerfilID.Value = String.Empty; } else { JavaScriptHelper.Alert(this, Message.keyNoElimino, ""); this.txhPerfilID.Value = String.Empty; } }
protected void btnPassReset_Click(object sender, EventArgs e) { UsuarioBL oUsuarioBL = new UsuarioBL(); oUsuarioBL.ErrorEvent += new UsuarioBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent); oUsuarioBE = (UsuarioBE)ViewState["oUsuarioBE"]; int retorno; try { (Master as Seguridad).onError = false; retorno = oUsuarioBL.ModificarPassWord(this.oUsuarioBE.CUSR_ID, txtClave.Text, Profile.Usuario.CUSR_ID, Profile.UsuarioRed, Profile.Estacion, "1", txtClave.Text);//I/F @016 if (!(Master as Seguridad).onError && retorno > 0) { JavaScriptHelper.Alert(this, "'La contraseña se reinicio exitosamente.'", String.Empty); } else if (retorno == -6) { JavaScriptHelper.Alert(this, "'La contraseña ya fue reinicializada.'", String.Empty); } else { JavaScriptHelper.Alert(this, Message.keyErrorGrabar, String.Empty); } } catch (Exception ex) { (Master as Seguridad).Web_ErrorEvent(this, ex); } }
protected void Page_Load(object sender, EventArgs e) { id = Request.QueryString["id"]; if (!IsPostBack) { if (Request.Cookies["memberinfo"] != null) { DB.Bind_Dropdownlist("select * from haoyou where memberid=" + Request.Cookies["memberinfo"]["MemberId"], tousername, "tousername", "tousername"); if (!string.IsNullOrEmpty(id)) { if (!string.IsNullOrEmpty(Request.QueryString["tousername"])) { tousername.SelectedValue = Request.QueryString["tousername"]; } Get_Data(); } } else { JavaScriptHelper.AlertAndRedirect("请先登录。", "userlogin.aspx"); return; } } }
protected void Page_Load(object sender, EventArgs e) { id = Request.QueryString["id"]; if (!IsPostBack) { if (Request.Cookies["memberinfo"] != null) { DB.Bind_Dropdownlist("select * from PicClass", ddlPicClass, "PicClassId", "PicClassName"); if (!string.IsNullOrEmpty(id)) { Image1.Visible = true; Get_Data(); } else { Image1.Visible = false; } } else { JavaScriptHelper.AlertAndRedirect("请先登录。", "userlogin.aspx"); return; } } }
protected override void OnPreRender(EventArgs e) { //VERY IMPORT FOR CHANGE CONTROL //Adds the compile version to the end of any links to css or javascript files forcing the browser to get the latest version upon first visit //foreach (var ctrl in Page.Header.Controls) // if (ctrl is HtmlLink) //Updates all .css files with .css?Rev=<VERSION> // ((HtmlLink)ctrl).Href = String.Concat( // ((HtmlLink)ctrl).Href, // "?Rev=", Session["Version"].ToString()); // else if (ctrl is LiteralControl)//Updates all .js files with .js?Rev=<VERSION> // ((LiteralControl)ctrl).Text = ((LiteralControl)ctrl).Text.Replace(".js\"", String.Format(".js?Rev={0}\"", Session["Version"].ToString())); base.OnPreRender(e); JavaScriptHelper.IncludeJQuery(Page.ClientScript); JavaScriptHelper.IncludeDropdown(Page.ClientScript); JavaScriptHelper.IncludeProduction(Page.ClientScript); JavaScriptHelper.IncludeResultMaster(Page.ClientScript); if ((bool?)HttpContext.Current.Session["benchmark"] ?? false) { HtmlMeta m = new HtmlMeta(); m.Attributes["http-equiv"] = "X-UA-Compatible"; m.Attributes["content"] = "IE=edge"; Page.Header.Controls.AddAt(0, m); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); JavaScriptHelper.IncludeJQuerySlider(Page.ClientScript); slider.Style.Add(HtmlTextWriterStyle.Width, this.width); slider.Style.Add(HtmlTextWriterStyle.Display, "inline-block"); slider.Style.Add(HtmlTextWriterStyle.VerticalAlign, "middle"); }
private static async Task <string> DecodeResponse(IHtmlDocument htmlDocument, HttpClient httpClient, HttpResponseMessage httpResponseMessage) { string responseString = await httpResponseMessage.Content.ReadAsStringAsync(); string responseJson = string.Empty; if (responseString.StartsWith("{")) { responseJson = responseString; } else { lock (DecodeResponseLock) { if (JintEngine == null) { IHtmlScriptElement appJsScript = htmlDocument.Scripts.FirstOrDefault(s => s.Source?.Contains("app.js") == true || s.Source?.Contains("app.min.js") == true || s.Source?.Contains("app.obf.js") == true || s.Source?.Contains("app.obf.min.js") == true ); Obfuscated = appJsScript.Source.Contains("obf."); string appJsSource = httpClient.GetStringAsync(appJsScript.Source.Replace("obf.", string.Empty)).GetAwaiter().GetResult(); List <JavaScriptHelper.Function> functions = JavaScriptHelper.Parse(appJsSource); JintEngine = new Engine(); JintEngine.Execute(functions.FirstOrDefault(f => f.Name == "read").Body); if (Obfuscated) { Func <string, string> atob = str => Encoding.Latin1.GetString(Convert.FromBase64String(str)); JintEngine.SetValue("atob", atob); JintEngine.Execute(functions.FirstOrDefault(f => f.Name == "gdidecode").Body); } } JsValue jsValue = JintEngine.Invoke("read", responseString); if (Obfuscated) { jsValue = JintEngine.Invoke("gdidecode", jsValue.ToString()); responseJson = jsValue.ToString(); } else { responseJson = Encoding.UTF8.GetString(Convert.FromBase64String(jsValue.ToString())); } } } return(responseJson); }
public static JsExpression Value(object value) { var s = JavaScriptHelper.ToJavaScriptValue(value); //if (value is char) // return Code(JavaScriptHelper.ToJavaScriptChar((char)value)); //else if(value is string) // return Code(JavaScriptHelper.ToJavaScriptString((string)value)); //var s = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(value); return(CodeExpression(s));//JavaScriptHelper.ToJavaScriptValue(value)); }
protected override void OnPreInit(EventArgs e) { if (!IsPostBack) { RemoveFromSession(InstanceStateKey); } base.OnPreInit(e); JavaScriptHelper.ClearLists(); }
/// <summary> /// Return a javascript block containing the contents of <paramref name="script" /> /// if <paramref name="condition" /> is true /// with an optional execution deferment. /// </summary> /// <param name="helper">The HTML helper instance that this method extends.</param> /// <param name="condition">The condition that must be met to display the script block.</param> /// <param name="script">The script to write to the script block.</param> /// <param name="defer">Whether or not to defer script execution until after page load completion.</param> /// <returns></returns> public static MvcHtmlString JSBlock(this HtmlHelper helper, bool condition, string script, bool defer) { if (condition) { return(MvcHtmlString.Create(JavaScriptHelper.BuildJavaScriptFragment(null, script, defer))); } else { return(MvcHtmlString.Empty); } }
protected void Btn_Import_TempAndRain20_Click(object sender, EventArgs e) { JavaScriptHelper.Loading("大人请稍后,奴才正在拼命计算..."); DateTime date = DateTime.Parse(DropDownList_Year.SelectedItem.Value + "-" + DropDownList_Month.SelectedItem.Value + "-01"); LiveData_BLL bll = new LiveData_BLL(); string message = bll.DataImportAFile(date); Label_DataMiss.Text = message; JavaScriptHelper.UnLoading(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Cookies["memberinfo"] != null) { JavaScriptHelper.AlertAndRedirect("您已经登录。", "usermain.aspx"); return; } } }
protected void btnBuscar_Click(object sender, ImageClickEventArgs e) { UsuarioBL oUsuarioBL = new UsuarioBL(); UsuarioBE oUsuarioBE = new UsuarioBE(); int perfilID; oUsuarioBL.ErrorEvent += new UsuarioBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent); oUsuarioBE.VNOMUSR = this.txtNombres.Text; oUsuarioBE.NO_APE_PATERNO = this.txtApeMat.Text; oUsuarioBE.NO_APE_MATERNO = this.txtApePat.Text; oUsuarioBE.NID_UBICA = 0; oUsuarioBE.NID_ROL = 0; Int32.TryParse(this.cboPerfil.SelectedValue, out perfilID); oUsuarioBE.NID_PERFIL = perfilID; oUsuarioBE.FL_INACTIVO = this.cboEstado.SelectedValue; oUsuarioBE.NU_TIPO_DOCUMENTO = this.txtNumDoc.Text; Int32 nidPuntoVenta = 0; Int32.TryParse(this.cboPuntoVenta.SelectedValue, out nidPuntoVenta); oUsuarioBE.VNOMUSR_CUSR_ID = this.txtLogin.Text.Trim(); oUsuarioListBE = oUsuarioBL.GetAllUsuarioBandeja(oUsuarioBE, Profile.Aplicacion); if (oUsuarioListBE == null || oUsuarioListBE.Count == 0) { JavaScriptHelper.Alert(this, Message.keyNoRegistros, String.Empty); oUsuarioListBE.Add(new UsuarioBE()); GuardaParametros(0); } else { this.txhCadenaTotalNum.Value = "|"; this.txhCadenaSelNum.Value = ""; txhFlagChekTodosNum.Value = ""; if (oUsuarioListBE != null || oUsuarioListBE.Count > 0) { for (int i = 0; i < oUsuarioListBE.Count; i++) { this.txhCadenaTotalNum.Value = this.txhCadenaTotalNum.Value + oUsuarioListBE[i].Nid_usuario.ToString() + "|"; } GuardaParametros(0); } GuardaParametros(1); } this.gvUsuarios.DataSource = oUsuarioListBE; this.gvUsuarios.DataBind(); ViewState["oUsuarioListBE"] = oUsuarioListBE; }
protected void btnEliminarMarca_Click(object sender, ImageClickEventArgs e) { MarcaBL oMarcaBL = new MarcaBL(); MarcaBE oMarcaBE = new MarcaBE(); oMarcaBL.ErrorEvent += new MarcaBL.ErrorDelegate(Master.Transaction_ErrorEvent); Int32 retorno; try { Master.onError = false; oMarcaBE.nid_marca = Int32.Parse(this.txhIdMarca.Value.Trim()); oMarcaBE.co_usuario_cambio = Profile.Usuario.CUSR_ID; oMarcaBE.no_estacion = Profile.Estacion; oMarcaBE.no_usuario_red = Profile.UsuarioRed; MarcaBE oMarcaBEMad = new MarcaBE(); oMarcaBEMad = oMarcaBL.GetById(oMarcaBE.nid_marca); oMarcaBE.sfe_cambio = ""; oMarcaBE.fl_inactivo = "1"; retorno = oMarcaBL.Eliminar(oMarcaBE); if (!Master.onError && retorno > 0) { //Si todo es exito recien mostrar mensaje de eliminación con exito JavaScriptHelper.Alert(this, Message.keyElimino, ""); btnBuscarMarca_Click(null, null); this.txhIdMarca.Value = String.Empty; } else { if (retorno == -5) { JavaScriptHelper.Alert(this, Message.keyNoEliminoRelacionado, ""); } else { JavaScriptHelper.Alert(this, Message.keyNoElimino, ""); } this.txhIdMarca.Value = String.Empty; } } catch (Exception ex) { Master.Web_ErrorEvent(this, ex); btnBuscarMarca_Click(null, null); JavaScriptHelper.Alert(this, Message.keyNoElimino, ""); } }
protected void Btn_Import_MonthEarlier_Click(object sender, EventArgs e) { JavaScriptHelper.Loading("大人请稍后,奴才正在拼命计算..."); DateTime date = DateTime.Parse(DropDownList_Year.SelectedItem.Value + "-" + DropDownList_Month.SelectedItem.Value + "-01"); LiveData_BLL bll = new LiveData_BLL(); StringBuilder message = new StringBuilder(); message.Append("1、" + bll.DataImportTemp08(date, 3)); message.Append("2、" + bll.DataImportTemp20(date, 3)); Label_DataMiss.Text = message.ToString(); JavaScriptHelper.UnLoading(); }
private void AddJavascript() { JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.CODE128.js", "code128", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.CODE39.js", "code39", this.GetType()); //404 error JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.EAN_UPC.js", "ean_upc", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.ITF.js", "itf", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.ITF14.js", "itf14", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JsBarcode.JsBarcode.js", "jsbarcode", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.ReportEngine.Barcode.js", "reportengine_barcode", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JQueryQRcode.jquery.qrcode.js", "reportengine_jquery_qrcode", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.JQueryQRcode.qrcode.js", "reportengine_qrcode1", this.GetType()); JavaScriptHelper.AddJSReference(this.Page, "MixERP.Net.WebControls.ReportEngine.Scripts.ReportEngine.QRCode.js", "reportengine_qrcode2", this.GetType()); }
protected void Button_Add08_Click(object sender, EventArgs e) { Score_Day_BLL bll = new Score_Day_BLL(); DateTime startTime = DateTime.Parse(DropDownList_Year.SelectedItem.Value + "-" + DropDownList_Month.SelectedItem.Value + "-01"); DateTime endTime = startTime.AddMonths(1); JavaScriptHelper.Loading("大人请稍后,奴才正在拼命计算..."); int count = bll.Add08_User(startTime, endTime); JavaScriptHelper.UnLoading(); Response.Write("<script language=javascript defer>alert('计算完成,共计:" + count.ToString() + "条数据!');</script>"); }
/// <summary> /// 按钮事件:提交信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (!Directory.Exists(Server.MapPath(folder))) { Directory.CreateDirectory(Server.MapPath(folder)); } string bakpath = folder + "db_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".bak"; DB.ExecuteSql("backup database " + dbname + " to disk='" + Server.MapPath(bakpath) + "'"); JavaScriptHelper.Success(this, "备份成功", Request.Url.AbsoluteUri); }
/// <summary> /// Displays a configurable paging control for instances of PagedList. /// </summary> /// <param name="html">This method is meant to hook off HtmlHelper as an extension method.</param> /// <param name="list">The PagedList to use as the data source.</param> /// <param name="formId">Id of the firm, which is used to submit data.</param> /// <param name="routeValues">Additional parameters to pass to server.</param> /// <param name="actionUrl">Url for the form where it should submit.</param> /// <param name="validation">Should or not form validate data in form.</param> /// <returns></returns> public static MvcHtmlString DVSPagedListPager(this System.Web.Mvc.HtmlHelper html, IPagedList list, string formId, Func<int, RouteValueDictionary> routeValues, string actionUrl, ValidationType validation = ValidationType.None) { if (list == null) throw new ArgumentNullException("list"); if (routeValues == null) throw new ArgumentNullException("routeValues"); if (String.IsNullOrWhiteSpace(actionUrl)) throw new ArgumentNullException("actionUrl"); if (String.IsNullOrWhiteSpace(formId)) throw new ArgumentNullException("formId"); var options = new PagedListRenderOptions { LinkToPreviousPageFormat = "<", LinkToNextPageFormat = ">", DisplayLinkToFirstPage = true, LinkToFirstPageFormat = "1", DisplayLinkToLastPage = true, LinkToLastPageFormat = list.PageCount.ToString(), EllipsesFormat = "..", MaximumPageNumbersToDisplay = 5, ContainerDivClasses = new string[] { "PagedList-pager" } }; var jsHelper = new JavaScriptHelper(); Func<int, string> pageAction = page => jsHelper.GetSubmitScript(formId, routeValues(page), actionUrl, validation); return DVSPagedListPager(html, list, pageAction, options); }