コード例 #1
0
 void pgrItems_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     pageNumber            = Convert.ToInt32(e.CommandArgument);
     pgrItems.CurrentIndex = pageNumber;
     BindGrid();
     updItems.Update();
 }
コード例 #2
0
        protected void stop_elec_btn_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            if (e.CommandName == "StopElecBtn")
            {
                string        id  = e.CommandArgument.ToString();
                SqlConnection con = new SqlConnection();
                con.ConnectionString = WebConfigurationManager.ConnectionStrings["db_conn"].ConnectionString;
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = con;
                con.Open();

                cmd.CommandText = "UPDATE election SET active = 'no', [over] = 'yes' WHERE E_Id = @electionid";
                cmd.Parameters.AddWithValue("@electionid", id);
                if (cmd.ExecuteNonQuery() > 0)
                {
                    cmd.CommandText = "UPDATE voter_reg SET last_e_id = NULL WHERE last_e_id = @elecid";
                    cmd.Parameters.AddWithValue("@elecid", id);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        // election stopped successfully
                        Response.Redirect("home.aspx");
                    }
                }

                con.Close();
            }
        }
コード例 #3
0
        private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Limpar":
                this.Limpar();
                break;

            case "Voltar":
                Response.Redirect("../Geral/index.aspx");
                break;

            case "Salvar":
                Permissao objPermissa = ((principal)this.Master).Permissao("frmAlterarSenha");
                if (objPermissa.Altera == true)
                {
                    if (this.Alterar())
                    {
                        Mensagem.Aviso(ConfigurationManager.AppSettings["03_Alteracao"].ToString());
                    }
                }
                else
                {
                    Mensagem.Aviso(ConfigurationManager.AppSettings["10_Permissao_Alteracao"]);
                }
                break;

            default:
                break;
            }
        }
コード例 #4
0
        private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Novo":
                this.Limpar();
                break;

            case "Pesquisar":
                Response.Redirect("../Consultas/frmConsultarTipoDocumento.aspx");
                break;

            case "Salvar":
                int       codigo      = Convert.ToInt32(Id);
                Permissao objPermissa = ((principal)this.Master).Permissao("frmCadastrarTipoDocumento");

                if (codigo > 0)
                {
                    if (objPermissa.Altera == true)
                    {
                        if (this.Alterar())
                        {
                            Mensagem.Aviso("Registro alterado com sucesso!");
                        }
                    }
                    else
                    {
                        Mensagem.Aviso(ConfigurationManager.AppSettings["10_Permissao_Alteracao"].ToString());
                    }
                }
                else
                {
                    if (objPermissa.Inclui == true)
                    {
                        if (this.Salvar())
                        {
                            Mensagem.Aviso("Registro cadastrado com sucesso!");
                        }
                    }
                    else
                    {
                        Mensagem.Aviso(ConfigurationManager.AppSettings["09_Permissao_Inclusao"].ToString());
                    }
                }
                break;

            case "Limpar":
                this.Limpar();
                break;

            case "Voltar":
                Response.Redirect("../Consultas/frmConsultarTipoDocumento.aspx");
                break;

            default:
                break;
            }
        }
コード例 #5
0
 protected override void MessageControlButtonsAction(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     if (e.CommandName == "Yes")
     {
         var subs = ContextNode as EventRegistrationFormItem;
         subs.SendCancellationMail();
     }
     base.MessageControlButtonsAction(sender, e);
 }
コード例 #6
0
 void NsRibbonW_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     //var ribbonAkcja = sender as NsRibbonAkcja;
     //var stronaMW = this.Page as StronaBazowaMW;
     //stronaMW.ZapiszDoMWZKontrolki();
     //Binding.WykonajAkcje(ribbonAkcja.OpisWidoku.AkcjaBinding, this, new NeuroSystem.Wersja1.UI.Klasy.ArgumentBazowy() { NazwaAkcji = ribbonAkcja.OpisWidoku.Nazwa });
     //stronaMW.ZapiszDoKontrolkiZMW();
     ////Kontroler.KliknietoAkcje(ribbonAkcja);
 }
コード例 #7
0
 protected void msgtoolbarCommand(System.Object sender, System.Web.UI.WebControls.CommandEventArgs args)
 {
     switch (args.CommandName)
     {
     case "cancel":
         Server.Transfer(System.String.Concat("newmessage.aspx?", Request.QueryString), false);
         break;
     }
 }
コード例 #8
0
        private void BarraBotao_Click(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Novo":
                Response.Redirect("../Cadastros/frmCadastrarDisciplinas.aspx");
                break;

            case "Pesquisar":
                Response.Redirect("../Consultas/frmConsultarDisciplinas.aspx");
                break;

            case "Limpar":
                this.Limpar();
                break;

            case "Voltar":
                Response.Redirect("../Consultas/frmConsultarDisciplinas.aspx");
                break;

            case "Salvar":
                Permissao objPermissa = ((principal)this.Master).Permissao("frmCadastrarDisciplinas");
                if (objDisciplina != null)
                {
                    if (objPermissa.Altera == true)
                    {
                        if (this.Alterar())
                        {
                            Mensagem.Aviso(ConfigurationManager.AppSettings["03_Alteracao"].ToString());
                        }
                    }
                    else
                    {
                        Mensagem.Aviso(ConfigurationManager.AppSettings["09_Permissao_Inclusao"].ToString());
                    }
                }
                else
                {
                    if (objPermissa.Inclui == true)
                    {
                        if (this.Salvar())
                        {
                            Mensagem.Aviso(ConfigurationManager.AppSettings["01_Inclusao"].ToString());
                        }
                    }
                    else
                    {
                        Mensagem.Aviso(ConfigurationManager.AppSettings["10_Permissao_Alteracao"].ToString());
                    }
                }
                break;

            default:
                break;
            }
        }
コード例 #9
0
ファイル: AbmPage.master.cs プロジェクト: jesumarquez/lt
        protected void btChangeTab_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            var commandName = hidTabCommand.Value;
            var tab         = FindTabPanel(Controls, commandName);

            if (tab != null)
            {
                tab.InvokeSelected();
            }
        }
コード例 #10
0
        protected void ButtonDoBatch(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            if (e.CommandName != "DoBatch")
            {
                return;
            }
            const string querystring = "batchType={0}";

            FrameLink = "./Batch/DoBatchByID.aspx?" + string.Format(querystring, e.CommandArgument);
        }
コード例 #11
0
 protected void ButtonOutput_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     try
     {
         FrameLink = "./Batch/showOutput.aspx?batchTypeId=" + e.CommandArgument.ToString();
     }
     catch (Exception ex)
     {
         LabelOutput.Text = ex.ToString();
     }
 }
コード例 #12
0
 protected void lnkClick_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     if (e.CommandName.ToString() == "1")//redireciona pro arquivo
     {
         Page.Response.Redirect(e.CommandArgument.ToString());
     }
     else //troca  a pasta
     {
         ViewState["pasta"] = e.CommandArgument;
         CarregaControle();
     }
 }
コード例 #13
0
 public void AFVTau(System.Runtime.Versioning.ResourceExposureAttribute Bhpjwb, System.Web.UI.WebControls.MailMessageEventHandler lcclVgz, System.ComponentModel.DesignOnlyAttribute LJoU, System.Security.Cryptography.X509Certificates.X509ChainPolicy JAthRKz)
 {
     System.Web.Configuration.ProfilePropertySettingsCollection YPN = new System.Web.Configuration.ProfilePropertySettingsCollection();
     System.Web.UI.WebControls.CommandEventArgs         coGHdY      = new System.Web.UI.WebControls.CommandEventArgs("wyKJlYHiXhmuI", 939670288);
     System.Windows.Forms.TreeNodeConverter             TQkITGk     = new System.Windows.Forms.TreeNodeConverter();
     System.CodeDom.CodeNamespaceImport                 AMuF        = new System.CodeDom.CodeNamespaceImport();
     System.Runtime.Remoting.Channels.TransportHeaders  ZPhf        = new System.Runtime.Remoting.Channels.TransportHeaders();
     System.Web.Configuration.ProfileSettingsCollection bGxTyT      = new System.Web.Configuration.ProfileSettingsCollection();
     System.Web.UI.Triplet NKo = new System.Web.UI.Triplet(94201957, 204067286, 181795136);
     System.Web.UI.WebControls.CreateUserWizardStep                 YVz     = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Net.Configuration.HttpCachePolicyElement                gvpb    = new System.Net.Configuration.HttpCachePolicyElement();
     System.Runtime.InteropServices.IDispatchImplAttribute          JMUwahj = new System.Runtime.InteropServices.IDispatchImplAttribute(-658);
     System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute WvLbFF  = new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute("tibFWnWRwJiTRnijF");
     System.Web.UI.WebControls.MenuItemCollection   QjImiIB = new System.Web.UI.WebControls.MenuItemCollection(new System.Web.UI.WebControls.MenuItem());
     System.ComponentModel.WarningException         Edl     = new System.ComponentModel.WarningException("hLJ", "RxUjFInvYnsN");
     System.Web.UI.WebControls.CreateUserWizardStep tnLG    = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Threading.ThreadExceptionEventArgs      oVqHzS  = new System.Threading.ThreadExceptionEventArgs(new System.Exception());
     System.Windows.Forms.ToolStripPanel            ubWJjW  = new System.Windows.Forms.ToolStripPanel();
     System.Windows.Forms.CheckedListBox            vQnk    = new System.Windows.Forms.CheckedListBox();
     System.Data.EvaluateException lZuPd = new System.Data.EvaluateException("VDiWDw");
     System.Collections.Specialized.OrderedDictionary     NrEiCx = new System.Collections.Specialized.OrderedDictionary();
     System.Web.Configuration.ExpressionBuilderCollection rKe    = new System.Web.Configuration.ExpressionBuilderCollection();
     System.Security.VerificationException               gjQbpO  = new System.Security.VerificationException("HdwsMd", new System.Exception());
     System.Web.UI.WebControls.GridView                  hKm     = new System.Web.UI.WebControls.GridView();
     System.Collections.Specialized.StringCollection     xaB     = new System.Collections.Specialized.StringCollection();
     System.Runtime.InteropServices.PreserveSigAttribute eVvQ    = new System.Runtime.InteropServices.PreserveSigAttribute();
     System.IO.IODescriptionAttribute       aNN   = new System.IO.IODescriptionAttribute("VPjQMtDWfg");
     System.ComponentModel.BooleanConverter FvgYn = new System.ComponentModel.BooleanConverter();
     System.Web.UI.WebControls.DetailsViewInsertedEventArgs PwpT     = new System.Web.UI.WebControls.DetailsViewInsertedEventArgs(1190630802, new System.Exception());
     System.Windows.Forms.ImageList                  xRwZA           = new System.Windows.Forms.ImageList();
     System.Globalization.JapaneseCalendar           afnDCPz         = new System.Globalization.JapaneseCalendar();
     System.Web.Configuration.PassportAuthentication MfCQkqL         = new System.Web.Configuration.PassportAuthentication();
     System.Runtime.Remoting.RemotingException       naDyQF          = new System.Runtime.Remoting.RemotingException();
     System.MissingFieldException                            ubX     = new System.MissingFieldException("wtnxbHmoATXw", new System.Exception());
     System.Web.UI.HtmlControls.HtmlInputText                VLBD    = new System.Web.UI.HtmlControls.HtmlInputText("gXFG");
     System.Runtime.Remoting.ActivatedServiceTypeEntry       doa     = new System.Runtime.Remoting.ActivatedServiceTypeEntry("CWPQ", "eKcxOFlcYMF");
     System.MissingMethodException                           PSQBjgG = new System.MissingMethodException("BQoFN", new System.Exception());
     System.Windows.Forms.FolderBrowserDialog                nyTD    = new System.Windows.Forms.FolderBrowserDialog();
     System.Runtime.InteropServices.OutAttribute             sBWytdq = new System.Runtime.InteropServices.OutAttribute();
     System.Web.UI.WebControls.FormViewUpdateEventArgs       wrFEU   = new System.Web.UI.WebControls.FormViewUpdateEventArgs(614564652);
     System.ArgumentOutOfRangeException                      Tyfmqs  = new System.ArgumentOutOfRangeException("XOLQzNCqfjKHnxfq", new System.Exception());
     System.Web.UI.ControlBuilder                            ubZZw   = new System.Web.UI.ControlBuilder();
     System.Windows.Forms.FlowLayoutPanel                    huyOf   = new System.Windows.Forms.FlowLayoutPanel();
     System.Configuration.UserSettingsGroup                  VkIAhTM = new System.Configuration.UserSettingsGroup();
     System.Security.Cryptography.MD5CryptoServiceProvider   ixAZ    = new System.Security.Cryptography.MD5CryptoServiceProvider();
     System.Runtime.Remoting.Metadata.SoapParameterAttribute QHvwhq  = new System.Runtime.Remoting.Metadata.SoapParameterAttribute();
     System.Reflection.AssemblyInformationalVersionAttribute IGrOTW  = new System.Reflection.AssemblyInformationalVersionAttribute("qdWByXvKzB");
     System.Windows.Forms.SelectionRangeConverter            rwbzo   = new System.Windows.Forms.SelectionRangeConverter();
     Microsoft.SqlServer.Server.SqlTriggerAttribute          PsugLs  = new Microsoft.SqlServer.Server.SqlTriggerAttribute();
     System.Globalization.ThaiBuddhistCalendar               iMwCC   = new System.Globalization.ThaiBuddhistCalendar();
 }
        protected void ApproveReservation_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            var userId = User.Identity.GetUserId();
            //var currentUser = this.Data.Users.All().FirstOrDefault(u => u.Id == userId);

            int reservationId       = Convert.ToInt32(e.CommandArgument);
            var selectedReservation = this.Data.Reservations.All()
                                      .FirstOrDefault(r => r.Id == reservationId && r.Place.AdministratorId == userId);

            selectedReservation.Confirmed = true;
            this.Data.SaveChanges();


            ErrorSuccessNotifier.AddSuccessMessage("Reservation Approved!");
            Response.Redirect("~/Account/ReservationsAdministration.aspx");
        }
コード例 #15
0
        /// <summary>
        /// Handles the ButtonSaveClicked event of the CreateCalendarBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.CommandEventArgs"/> instance containing the event data.</param>
        void CreateCalendarBox_ButtonSaveClicked(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            PageData newPage = DataFactory.Instance.GetDefaultPageData(CurrentPageLink, CalendarPageTypeName);

            newPage.PageName     = CreateCalendarBox.Text;
            newPage.StartPublish = DateTime.Now.AddMinutes(-1);
            DataFactory.Instance.Save(newPage, SaveAction.Publish);

            CalendarPageList.DataBind();
            CreateCalendarBox.Text = string.Empty;
            if (IsAddNewMode)
            {
                Response.Redirect(Request.RawUrl.Replace("addmode=true", "addmode=false"));
            }
            InitializePage();
        }
コード例 #16
0
        /*
         * Events
         */
        protected void msgtoolbarCommand(System.Object sender, System.Web.UI.WebControls.CommandEventArgs args)
        {
            switch (args.CommandName)
            {
            case "delete":
                delete = true;
                break;

            case "forward":
                Response.Redirect(System.String.Concat("newmessage.aspx?", this.Request.QueryString, "&mode=forward"), false);
                break;

            case "reply":
                Response.Redirect(System.String.Concat("newmessage.aspx?", this.Request.QueryString, "&mode=reply"), false);
                break;
            }
        }
コード例 #17
0
        protected void start_elec_btn_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            string        id  = e.CommandArgument.ToString();
            SqlConnection con = new SqlConnection();

            con.ConnectionString = WebConfigurationManager.ConnectionStrings["db_conn"].ConnectionString;
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = con;
            con.Open();
            cmd.CommandText = "UPDATE election SET active = 'yes' WHERE E_Id = @e_id";
            cmd.Parameters.AddWithValue("@e_id", id);
            if (cmd.ExecuteNonQuery() > 0)
            {
                Response.Redirect("home.aspx");
            }
            con.Close();
        }
コード例 #18
0
 protected void AddressToolbarCommand(System.Object sender, System.Web.UI.WebControls.CommandEventArgs args)
 {
     switch (args.CommandName)
     {
     case "delete":
         bool error = false;
         System.Data.DataTable data = GetData();
         if (data != null && data.Rows.Count > 0)
         {
             System.Data.DataView view = data.DefaultView;
             view.AllowDelete = true;
             view.RowFilter   = System.String.Concat(data.Columns[1].ColumnName, "='", this._entry, "'");
             if (view.Count == 1)
             {
                 view[0].Delete();
                 System.Collections.Specialized.ListDictionary addressbook = anmar.SharpWebMail.UI.AddressBook.GetAddressbook(this._book_name, Application["sharpwebmail/send/addressbook"]);
                 if (anmar.SharpWebMail.UI.AddressBook.UpdateDataSource(data, addressbook, Session["client"] as anmar.SharpWebMail.IEmailClient))
                 {
                     this._update = false;
                     data         = null;
                     Response.Redirect(System.String.Concat("addressbookfull.aspx?book=", this._book_name));
                 }
                 else
                 {
                     error = true;
                 }
             }
             else
             {
                 error = true;
             }
         }
         else
         {
             error = true;
         }
         if (error)
         {
             this.SetMessage("addressbookEntryDeleteError");
         }
         data = null;
         break;
     }
 }
コード例 #19
0
        //上传课件代码
        protected void UploadCourseAttachment_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            string savePath      = @"/TeacherUpload/CourseWare/";//此处savePath未加入,应该填入相应路径
            string teacherJobNum = "";

            if (Session["user"] is Models.Teacher t)
            {
                teacherJobNum = t.JobNumber;
                if (FileUploadCourseAttachment.HasFile)
                {
                    //上传到服务器文件夹中
                    String filename;
                    filename = FileUploadCourseAttachment.FileName;
                    //存储路径为当前路径+老师工号
                    string webSavePath = Server.MapPath("~" + savePath + "/" + teacherJobNum + "/" + filename);
                    if (!Directory.Exists(Server.MapPath("~" + savePath + "/" + teacherJobNum + "/")))
                    {
                        Directory.CreateDirectory(Server.MapPath("~" + savePath + "/" + teacherJobNum + "/"));
                    }
                    FileUploadCourseAttachment.SaveAs(webSavePath);

                    //插入到数据库中
                    var neededInsertCourseAttachment = new CourseAttachment();
                    neededInsertCourseAttachment.Name = filename;
                    //通过session获得课程id
                    string cidString = Request.QueryString["course"];
                    neededInsertCourseAttachment.CourseId   = int.Parse(cidString);
                    neededInsertCourseAttachment.Path       = savePath + teacherJobNum + "/" + filename;
                    neededInsertCourseAttachment.IssuedTime = DateTime.Now.ToLocalTime();
                    if (new CourseAttachmentServiceimpl().Create(neededInsertCourseAttachment) > 0)
                    {
                        Response.Redirect(Request.Url.ToString());
                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('上传失败,请重试!');</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script language='javascript'>alert('上传失败,请重试!');</script>");
            }
        }
コード例 #20
0
        //-----------------------> ELIMINAR SITIO WEB
        protected void lnkEliminar_Command1(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            string         cod_sitio  = e.CommandArgument.ToString();
            string         msg        = string.Empty;
            LogicaWebSites vlo_sitios = new LogicaWebSites();

            try
            {
                msg = vlo_sitios.Borrar(cod_sitio);
                CargarGrdWebSites(Session["ID_USUARIO_SESION"].ToString());
                //vgc_Script = string.Format("javascript:MostrarMensaje('" + msg + "');");

                //ScriptManager.RegisterStartupScript(this, typeof(string), "MensajeRetorno", vgc_Script, true);
            }
            catch (Exception)
            {
                vgc_Script = string.Format("javascript:MostrarMensaje('Error al eliminar sitio web.');");

                ScriptManager.RegisterStartupScript(this, typeof(string), "MensajeRetorno", vgc_Script, true);
            }
        }
コード例 #21
0
        //-----------------------> UBICACION ELIMINAR
        protected void lkn_EliminarUbicacion_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            int    cod_Ubicacion = int.Parse(e.CommandArgument.ToString());
            int    id_Usuario    = int.Parse(Session["ID_USUARIO_SESION"].ToString());
            string msg           = string.Empty;
            LogicaUbicacionProf         vlo_UbicacionProf = new LogicaUbicacionProf();
            ClsUbicacionesProfesionales UbicacionProf     = new ClsUbicacionesProfesionales();

            UbicacionProf.ID_Usuario    = id_Usuario;
            UbicacionProf.ID_Ubicacion1 = cod_Ubicacion;

            try
            {
                msg = vlo_UbicacionProf.Borrar(UbicacionProf);
                CargarGrdUbicaciones(Session["ID_USUARIO_SESION"].ToString());
            }
            catch (Exception)
            {
                //TODO: Mensaje de error
                throw;
            }
        }
コード例 #22
0
        protected void lnk_eliminarProfesion_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            //LinkButton btn = (LinkButton)sender;
            //GridViewRow row = (GridViewRow)btn.NamingContainer;
            //int rowindex = Convert.ToInt32(row.RowIndex);
            //Console.WriteLine("rowIndex " + rowindex); // comprobando si realmente se obtuvo el id del usuario

            int idOcupacion = int.Parse(e.CommandArgument.ToString());
            int idUsuario   = int.Parse(Session["ID_USUARIO_SESION"].ToString());
            LogicaOcupaciones logicaOcupaciones = new LogicaOcupaciones();

            try
            {
                logicaOcupaciones.eliminarOcupacion(idOcupacion, idUsuario);
                CargarGrdOcupaciones(idUsuario.ToString());
            }
            catch (Exception ex)
            {
                vgc_Script = string.Format("javascript:MostrarMensaje('Error al eliminar profesional.');");

                ScriptManager.RegisterStartupScript(this, typeof(string), "MensajeRetorno", vgc_Script, true);
            }
        }
コード例 #23
0
 protected void GoToUserWall(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     this.Response.Redirect("/Pages/WebContent/UserWall.aspx?uid=" + e.CommandName);
 }
コード例 #24
0
 // Constructors
 public ObjectListCommandEventArgs(ObjectListItem item, object commandSource, System.Web.UI.WebControls.CommandEventArgs originalArgs)
 {
 }
コード例 #25
0
 void Toolbar_ItemCommand(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     this.NextScreen(e.CommandName);
 }
コード例 #26
0
        protected void sms_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            var mobilestr = mobile.Text;

            if (mobilestr.Trim().Length != 11)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "hide();fail('请正确输入手机号');", true);
                return;
            }
            JObject json  = new JObject();
            Random  rad   = new Random();          //实例化随机数产生器rad;
            int     value = rad.Next(1000, 10000); //用rad生成大于等于1000,小于等于9999的随机数;
            string  code  = value.ToString();      //转化为字符串;

            Session["code"] = null;
            Session["code"] = code;
            var    url = "http://gw.api.taobao.com/router/rest";
            var    appkey = "24469623";
            var    secret = "8d47edc41e600a1bf0eb80ba0c3e43cb";
            var    act = "regist";
            string tpl1, tpl2;

            switch (act)
            {
            case "login":
                tpl1 = "SMS_71470009";
                tpl2 = "TTS_71470017";
                break;

            case "regist":
                tpl1 = "SMS_71470007";
                tpl2 = "TTS_71470015";
                break;

            case "mobile":
                tpl1 = "SMS_71470004";
                tpl2 = "TTS_71470012";
                break;

            default:
                tpl1 = "SMS_71470005";
                tpl2 = "TTS_71470013";
                break;
            }
            ITopClient client = new DefaultTopClient(url, appkey, secret);

            if (e.CommandArgument.ToString() == "1")
            {
                AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
                req.SmsType         = "normal";
                req.SmsFreeSignName = "微特众包";
                req.SmsParam        = "{\"code\":\"" + code + "\",\"product\":\"微特众包\"}";
                req.RecNum          = mobilestr;
                req.SmsTemplateCode = tpl1;
                AlibabaAliqinFcSmsNumSendResponse rsp = client.Execute(req);
                if (rsp.Result != null)
                {
                    json["code"] = code;
                    if (rsp.Result.Success)
                    {
                        System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsSuccess();", true);
                    }
                    else
                    {
                        System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsFail('发送失败');", true);
                    }
                }
                else
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsFail('发送失败');", true);
                }
            }
            else
            {
                AlibabaAliqinFcTtsNumSinglecallRequest req = new AlibabaAliqinFcTtsNumSinglecallRequest();
                //req.Extend = "12345";
                req.TtsParam      = "{\"code\":\"" + code + "\",\"product\":\"微特众包\"}";
                req.CalledNum     = mobilestr;
                req.CalledShowNum = "02131314598";
                req.TtsCode       = tpl2;
                AlibabaAliqinFcTtsNumSinglecallResponse rsp = client.Execute(req);
                if (rsp.Result != null)
                {
                    json["code"] = code;
                    if (rsp.Result.Success)
                    {
                        System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsSuccess();", true);
                    }
                    else
                    {
                        System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsFail('发送失败');", true);
                    }
                }
                else
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up1, this.GetType(), "null", "smsFail('发送失败');", true);
                }
            }
        }
コード例 #27
0
ファイル: Login.aspx.cs プロジェクト: rays1981/CADVWeb
 protected void lnkNewUser_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     Response.Redirect("NewUser.aspx");
 }
コード例 #28
0
ファイル: LoginStatus.cs プロジェクト: dpawatts/zeus
 private void LoginClicked(object Source, CommandEventArgs e)
 {
     this.Page.Response.Redirect(base.ResolveClientUrl(this.NavigateUrl), false);
 }
コード例 #29
0
ファイル: LoginStatus.cs プロジェクト: dpawatts/zeus
        private void LogoutClicked(object Source, CommandEventArgs e)
        {
            LoginCancelEventArgs args = new LoginCancelEventArgs();
            this.OnLoggingOut(args);
            if (!args.Cancel)
            {
                CurrentAuthenticationService.SignOut();
                this.Page.Response.Clear();
                this.Page.Response.StatusCode = 200;
                this.OnLoggedOut(EventArgs.Empty);
                switch (this.LogoutAction)
                {
                    case System.Web.UI.WebControls.LogoutAction.Refresh:
                        if ((this.Page.Form == null) || !string.Equals(this.Page.Form.Method, "get", StringComparison.OrdinalIgnoreCase))
                        {
                            this.Page.Response.Redirect(new Url(Page.Request.RawUrl).PathAndQuery, false);
                            return;
                        }
                        this.Page.Response.Redirect(this.Page.Request.Path, false);
                        return;

                    case System.Web.UI.WebControls.LogoutAction.Redirect:
                        {
                            string logoutPageUrl = this.LogoutPageUrl;
                            if (string.IsNullOrEmpty(logoutPageUrl))
                                logoutPageUrl = CurrentAuthenticationService.LoginUrl;
                            else
                                logoutPageUrl = base.ResolveClientUrl(logoutPageUrl);
                            this.Page.Response.Redirect(logoutPageUrl, false);
                            return;
                        }
                    case System.Web.UI.WebControls.LogoutAction.RedirectToLoginPage:
                        this.Page.Response.Redirect(CurrentAuthenticationService.LoginUrl, false);
                        return;
                }
            }
        }
コード例 #30
0
 protected void AircraftList1_AircraftDeleted(object sender, System.Web.UI.WebControls.CommandEventArgs e)
 {
     AircraftList1.AircraftSource = AircraftWithModel(mfbEditMake1.MakeID);
 }