Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                SqlConnection conn = new SqlConnection();
                conn.ConnectionString = "Data Source=.;Initial Catalog=borrowDB3;Integrated Security=True";
                conn.Open();
                string        str = "select name_type from Type ";
                SqlCommand    cmd = new SqlCommand(str, conn);
                SqlDataReader rdr = cmd.ExecuteReader();

                DropDownList1.Items.Clear();
                DropDownList1.Items.Add("اختار تصنيف اساسى للكتاب");
                if (rdr.HasRows)
                {
                    while (rdr.Read())
                    {
                        DropDownList1.Items.Add(rdr["name_type"].ToString());
                    }
                }
                else
                {
                    Response.Write("Sorry Try again");
                }
                rdr.Close();

                conn.Close();
            }


            TextBox1.Focus();
        }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((Request.QueryString["Acao"] != null) &&
            (Request.QueryString["Acao"].ToString() == "Sair"))
        {
            if (Session["Grupo"] != null)
            {
                Session["Grupo"] = null;
            }
            if (Session["CodigoUsuario"] != null)
            {
                Session["CodigoUsuario"] = null;
            }
            if (Session["Usuario"] != null)
            {
                Session["Usuario"] = null;
            }
            Response.Redirect("~/Login.aspx");
        }

        if (TextBox1.Text.Trim() == String.Empty)
        {
            TextBox1.Focus();
        }
        else
        {
            TextBox2.Focus();
        }
    }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session.Clear();
                Label1.Text      = "WikiSearch";
                Label1.ForeColor = System.Drawing.Color.DeepSkyBlue;
                Label1.Font.Bold = true;


                //TextBox1.BorderColor = System.Drawing.Color.LightGray;
                repLinks.Visible = false;
                Label1.TabIndex  = 0;
                Label2.Style.Add("color", "#9c9c9c");
                //Literal lit1 = new Literal();
                //lit1.Text = @"<span class='glyphicon glyphicon-search'></span> ";
                //Button1.Text = lit1.Text;
                LinkButton1.Visible = false;
                LinkButton2.Visible = false;
            }

            Label2.Font.Bold = true;
            TextBox1.Focus();
            Label2.Visible      = false;
            LinkButton4.Text    = "";
            Label3.Visible      = false;
            LinkButton4.Visible = false;
        }
Exemplo n.º 4
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Text = string.Empty;
     TextBox2.Text = string.Empty;
     TextBox1.Focus();
     Button1.Text = "Submit";
 }
Exemplo n.º 5
0
 protected void submit_Click(object sender, ImageClickEventArgs e)
 {
     if (TextBox1.Text == "")
     {
         Response.Write("<script>alert(\"请输入数量!\");</script>");
         TextBox1.Focus();
     }
     else
     {
         string        key        = GridView1.SelectedDataKey.Value.ToString();
         string        today      = DateTime.Now.ToString("yyyy-MM-dd");
         string        sqlconnstr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
         SqlConnection sqlconn    = new SqlConnection(sqlconnstr);
         SqlCommand    sqlcommand = new SqlCommand();
         sqlcommand.Connection  = sqlconn;
         sqlcommand.CommandText = "insert into orders(bookid,username,orderdate,quantity)values(@bookid,@username,@orderdate,@quantity)";
         sqlcommand.Parameters.AddWithValue("@bookid", key);
         sqlcommand.Parameters.AddWithValue("@username", Session["用户名"].ToString());
         sqlcommand.Parameters.AddWithValue("@orderdate", today);
         sqlcommand.Parameters.AddWithValue("@quantity", TextBox1.Text);
         try
         {
             sqlconn.Open();
             sqlcommand.ExecuteNonQuery();
             Response.Write("<script>alert(\"订购成功!\");</script>");
             Server.Transfer("orders.aspx");
         }
         finally
         {
             sqlcommand = null;
             sqlconn.Close();
             sqlconn = null;
         }
     }
 }
Exemplo n.º 6
0
        private void treeView1_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var item = TreeView1.SelectedItem as TreeViewItem;

            if (item == null)
            {
                return;
            }

            if (_parser.LocalFunctions.ContainsKey(item.Header.ToString()))
            {
                TextBox1.SelectedText = item.Header + "(";
                TextBox1.Focus();
                TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0);
            }
            else if (_parser.LocalVariables.ContainsKey(item.Header.ToString()))
            {
                TextBox1.SelectedText = item.Header + " := ";
                TextBox1.Focus();
                TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0);
            }
            else if (_parser.OperatorList.Contains(item.Header.ToString()))
            {
                TextBox1.SelectedText = item.Header.ToString();
                TextBox1.Focus();
                TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0);
            }
        }
Exemplo n.º 7
0
        private void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();

            if (bitmap != null)
            {
                try
                {
                    BarcodeReader reader = new BarcodeReader();

                    var result = reader.Decode(bitmap);
                    if (result != null)
                    {
                        TextBox1.Invoke(new MethodInvoker(delegate()
                        {
                            TextBox1.Text = result.ToString();
                        }));
                    }
                    pictureBox.Image = bitmap;
                }
                catch (Exception e)
                {
                    //MessageBox.Show("" + e);
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = new SqlCommand("insert into registration values(@pname,@age,@gender,@address,@city,@area,@pre_disease,@emailid,@phone_no,@password)", con);

            cmd.Parameters.AddWithValue("pname", TextBox1.Text);
            cmd.Parameters.AddWithValue("age", TextBox2.Text);
            cmd.Parameters.AddWithValue("gender", RadioButtonList1.SelectedValue);
            cmd.Parameters.AddWithValue("address", TextBox9.Text);
            cmd.Parameters.AddWithValue("city", DropDownList2.SelectedValue);
            cmd.Parameters.AddWithValue("area", DropDownList1.SelectedValue);
            cmd.Parameters.AddWithValue("pre_disease", TextBox5.Text);
            cmd.Parameters.AddWithValue("emailid", TextBox6.Text);
            cmd.Parameters.AddWithValue("phone_no", TextBox7.Text);
            cmd.Parameters.AddWithValue("password", TextBox8.Text);
            cmd.ExecuteNonQuery();
            TextBox1.Text  = "";
            TextBox2.Text  = "";
            TextBox9.Text  = "";
            TextBox5.Text  = "";
            TextBox6.Text  = "";
            TextBox7.Text  = "";
            TextBox8.Text  = "";
            TextBox10.Text = "";

            RadioButtonList1.SelectedValue = "";
            TextBox1.Focus();
            con.Close();
        }
Exemplo n.º 9
0
        private void 새로만들기NToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Dirty && TextBox1.Text != null)
            {
                if (SaveCheckForm.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }

                if (SaveCheckForm.DialogResult == DialogResult.OK)
                {
                    if (saveFileDialog1.ShowDialog() == DialogResult.Cancel)
                    {
                        return;
                    }

                    File.WriteAllText(saveFileDialog1.FileName, TextBox1.Text);
                }
            }



            TextBox1.Clear();
            IsDirty();
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string       sourcepath  = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            string       myfile      = System.IO.Path.Combine(sourcepath, "test.txt");
            StreamReader inputstream = File.OpenText(myfile);

            numberOfLines = File.ReadLines(myfile).Count();         //telt de regels van het document //Dit moet niet! je kan ook zo programmeren:
                                                                    //while(listlines.readline() != null)
                                                                    //words = listlines.readline().split(',')...

            string[] ListLines = new string[numberOfLines];         //hierin komen alle regels



            for (int i = 0; i < numberOfLines; i++)    //gaat de regels opsplitsen
            {
                ListLines[i] = inputstream.ReadLine(); //hierin worden de regels weggeschreven, gebruik split methoden als ge verschillende waardes in een array wilt laden
            }
            inputstream.Close();                       //sluit de inputstream

            int z = 0;

            words = ListLines[z].Split(';');
            for (int j = 0; j < words.Length; j++)
            {
                TextBox1.AppendText(words[j]);
            }
            TextBox1.AppendText(Environment.NewLine);
            z++;
        }
Exemplo n.º 11
0
 private void getleibie()
 {
     TextBox1.DataSource    = data.GetDataReader("select distinct leibie from wfshengqing where IsChk='否'");
     TextBox1.DataTextField = "leibie";
     //TextBox1.DataValueField = "id";
     TextBox1.DataBind();
 }
Exemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Label13.Text = "";
     TextBox1.Focus();
     getmid();
     TextBox7.Enabled = false;
 }
Exemplo n.º 13
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            conn.Open();
            cmd = new SqlCommand("insert into RestaurantDetails (Res_Name,Owner_Name,Restaurant_Type,Email,MOBILENo,State,City,Pincode,Full_Address) values ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + RadioButtonList1.SelectedValue + "','" + TextBox4.Text + "'," + TextBox3.Text + ",'" + DropDownList1.SelectedItem.Text + "','" + DropDownList2.SelectedValue + "'," + TextBox13.Text + ",'" + TextBox9.Text + "');insert into LoginDetails(Email, Pasword,usertype) values('" + TextBox4.Text + "','" + TextBox6.Text + "','RESTURANT')", conn);
            int X = cmd.ExecuteNonQuery();


            if (X > 0)
            {
                Label1.Text = "Registration Done dude";
            }
            else
            {
                Label1.Text = "Try again";
            }

            TextBox1.Text  = "";
            TextBox2.Text  = "";
            TextBox3.Text  = "";
            TextBox4.Text  = "";
            TextBox9.Text  = "";
            TextBox6.Text  = "";
            TextBox10.Text = "";
            TextBox13.Text = "";
            RadioButtonList1.SelectedIndex = -1;
            DropDownList1.SelectedIndex    = 0;
            DropDownList2.SelectedIndex    = 0;

            TextBox1.Focus();

            conn.Close();
        }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TextBox1.Focus();
        if (!IsPostBack)
        {
            DataList2.DataBind();
            cn.Open();
            cmd.Connection  = cn;
            cmd.CommandText = "select first_name, last_name  from login_detail where username=@username";
            cmd.Parameters.AddWithValue("@username", Session["username"].ToString());
            Session["firstName"] = "";
            //    string firstName= cmd.ExecuteScalar().ToString();
            reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                Session["firstName"] = reader["first_name"].ToString();
            }
            Label1.Text = Session["firstName"].ToString();
            Label2.Text = reader["last_name"].ToString();
            reader.Close();
            cmd.Parameters.Clear();
            cmd.CommandText = "select photo from profile_picture where username=@username";
            cmd.Parameters.AddWithValue("@username", Session["username"].ToString());

            try
            {
                string filepath = cmd.ExecuteScalar().ToString();
                ImageButton1.ImageUrl = filepath;
            }
            catch (Exception ex)
            {
                ImageButton1.ImageUrl = "~/profilepic/avatar.jpg";
            }



            cn.Close();

            cmd.Parameters.Clear();

            {
                cn.Open();
                cmd.Connection  = cn;
                cmd.CommandText = "select count(*) from friends where username=@username";
                cmd.Parameters.AddWithValue("@username", Session["username"].ToString());
                int count = Convert.ToInt32(cmd.ExecuteScalar());
                if (count != 0)
                {
                    Label3.Visible = false;
                }
                else
                {
                    Label3.Visible = true;
                    Label3.Text    = "No Friend to Delete";
                }
                cn.Close();
                cmd.Parameters.Clear();
            }
        }
    }
Exemplo n.º 15
0
    /// <summary>
    /// 注册按钮的实现
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        string bsql = "select count(*) from [Member_info] where Memberuid='" + TextBox1.Text.Trim() + "'";
        string flag = DB.FindString(bsql);

        if (Convert.ToInt32(flag) > 0)
        {
            MessageBox.Show(this, TextBox1.Text.Trim() + ",该商户名称已经存在.请使用其他名称");
            TextBox1.Focus();
            return;
        }
        else
        {
            if (CheckBox_xieyi.Checked)
            {
                //IpHelper.GetUserIp()
                string sql    = "insert into [Member_info](Memberuid,Memberpwd,Email,Mobile,IP,createtime,Memberid) values('" + TextBox1.Text.Trim() + "','" + TextBox2.Text.Trim() + "','" + TextBox3.Text.Trim() + "','" + TextBox4.Text.Trim() + "','" + IpHelper.GetUserIp() + "','" + DateTime.Now.ToString() + "','" + GetGuid.Guid() + "')";
                int    result = DbHelperOleDb.ExecuteSql(sql);
                if (result > 0)
                {
                    Session["Meber_uid"] = this.TextBox1.Text;
                    MessageBox.Show(this, "会员注册成功!");
                    Response.Redirect("../WebMember/Page_MemberInfo.aspx");
                }
            }
            else
            {
                MessageBox.Show(this, "您必须同意协议,才可以进行下一步.");
            }
        }
    }
Exemplo n.º 16
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text != "")
     {
         SqlConnection conn = new DataBase().getSqlConnection();
         SqlCommand    cmd  = conn.CreateCommand();
         cmd.CommandText = "select count(*) from 配件基础信息 where name ='" + TextBox1.Text.Trim().ToString() + "' and type='" + TextBox2.Text.Trim().ToString() + "'";
         try
         {
             conn.Open();
             if (Convert.ToInt32(cmd.ExecuteScalar().ToString()) == 0)
             {
                 if (TextBox5.Text == "")
                 {
                     TextBox5.Text = "0";
                 }
                 cmd.CommandText = "insert into 配件基础信息 values('" + TextBox1.Text.Trim().ToString() + "','" + TextBox2.Text.Trim().ToString() + "','" + TextBox3.Text.Trim().ToString() + "','" + TextBox4.Text.Trim().ToString() + "','" + DropDownList1.SelectedValue.ToString() + "'," + TextBox5.Text.Trim().ToString() + ",'" + TextBox6.Text.Trim().ToString() + "')";
                 cmd.ExecuteNonQuery();
             }
         }
         catch (Exception ex)
         { }
         finally
         {
             conn.Close();
         }
     }
     TextBox1.Text = "";
     TextBox2.Text = "";
     TextBox3.Text = "";
     TextBox4.Text = "";
     TextBox5.Text = "";
     TextBox6.Text = "";
     TextBox1.Focus();
 }
Exemplo n.º 17
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //实例化SqlConnection对象
        SqlConnection sqlCon = new SqlConnection();

        //实例化SqlConnection对象连接数据库的字符串
        sqlCon.ConnectionString = "server=AIR;uid=wtaure;pwd=123456;database=chubanshe";
        //定义SQL语句
        string SqlStr = "select * from news_messages where newsid='" + TextBox1.Text + "'";
        //实例化SqlDataAdapter对象
        SqlDataAdapter da = new SqlDataAdapter(SqlStr, sqlCon);
        //实例化数据集DataSet
        DataSet ds = new DataSet();

        da.Fill(ds, "news_messages");
        //绑定GridView控件

        GridView1.DataSource = ds; //设置数据源,用于填充控件中的项的值列表
        GridView1.DataBind();      //将控件及其所有子控件绑定到指定的数据源
        int i = GridView1.Rows.Count;

        if (i == 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "print", "<script>alert('没有满足条件的记录,请确定学号是否正确!')</script>");
        }
        // Response.Write(i.ToString ());
        TextBox1.Text = "";
        TextBox1.Focus();
    }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                TextBox1.Focus();
            }

            if (Request.QueryString["text"] == null)
            {
            }
            else
            {
                TextBox1.Text = Request.QueryString["text"].ToString();

                btnSubmit_Click(sender, e);
                btnSubmit.Visible = false;
                TextBox1.Visible  = false;

                System.Reflection.PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                // make collection editable
                isreadonly.SetValue(this.Request.QueryString, false, null);
                // remove
                this.Request.QueryString.Remove("text");
            }
        }
Exemplo n.º 19
0
 private void DateTimePicker1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TextBox1.Focus();
     }
 }
Exemplo n.º 20
0
 protected void Button1_Click1(object sender, EventArgs e)
 {
     if (kiemtratrung() == true)
     {
         Response.Write("<script>alert('san pham da ton tai')</script>");
         TextBox1.Text = "";
         TextBox2.Text = "";
         TextBox3.Text = "";
         TextBox4.Text = "";
         TextBox1.Focus();
     }
     else
     {
         SqlCommand command = new SqlCommand("insert into quanly(masp,tensp,soluong,tinhtrang) values('" + TextBox1.Text + "',N'" + TextBox2.Text + "','" + TextBox3.Text + "',N'" + TextBox4.Text + "')", con);
         con.Open();
         command.ExecuteNonQuery();
         con.Close();
         Response.Write("<script>alert('them san pham thanh cong')</script>");
         hamloaddata();
         TextBox1.Text = "";
         TextBox2.Text = "";
         TextBox3.Text = "";
         TextBox4.Text = "";
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int cnt = 0;

        cn.Open();
        cmd.Connection  = cn;
        cmd.CommandText = "select Count(*) from Admin_Login where Username='******' and Password='******'";
        rs = cmd.ExecuteReader();
        while (rs.Read())
        {
            cnt = int.Parse(rs.GetValue(0).ToString());
        }
        rs.Close();
        cmd.Dispose();
        cn.Close();

        if (cnt == 0)
        {
            Label1.Text   = "Invalid Username / Password";
            TextBox1.Text = "";
            TextBox2.Text = "";
            TextBox1.Focus();
        }
        else
        {
            Session["User"] = TextBox1.Text;
            Session["Type"] = "Admin";
            Response.Redirect("Admin_Home.aspx");
        }
    }
Exemplo n.º 22
0
    private void sign()
    {
        string        cs  = ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
        SqlConnection con = new SqlConnection(cs);
        {
            con.Open();
            string password   = TextBox5.Text;
            string usr        = TextBox4.Text;
            string str1       = usr + password;
            string hashedPass = EncodePasswordToBase64(str1);

            if (isVerified)
            {
                SqlCommand cmd = new SqlCommand("insert into userRegister values (@email, @password, @firstname, @middlename, @lastname, @gender, @contactNo, @alternateNo, @address, @landmark, @city, @state, @pin, @country, @bloodGr)", con);

                cmd.Parameters.AddWithValue("email", TextBox4.Text);
                cmd.Parameters.AddWithValue("password", hashedPass);
                cmd.Parameters.AddWithValue("firstname", TextBox1.Text);
                cmd.Parameters.AddWithValue("middlename", TextBox2.Text);
                cmd.Parameters.AddWithValue("lastname", TextBox3.Text);
                cmd.Parameters.AddWithValue("gender", DropDownList1.SelectedValue);
                cmd.Parameters.AddWithValue("contactNo", TextBox7.Text);
                cmd.Parameters.AddWithValue("alternateNo", TextBox8.Text);
                cmd.Parameters.AddWithValue("address", TextBox9.Text);
                cmd.Parameters.AddWithValue("landmark", TextBox10.Text);
                cmd.Parameters.AddWithValue("city", DropDownList2.SelectedValue);
                cmd.Parameters.AddWithValue("state", DropDownList3.SelectedValue);
                cmd.Parameters.AddWithValue("pin", TextBox11.Text);
                cmd.Parameters.AddWithValue("country", TextBox12.Text);
                cmd.Parameters.AddWithValue("bloodGr", DropDownList4.SelectedValue);

                int r = cmd.ExecuteNonQuery();

                TextBox1.Text  = "";
                TextBox2.Text  = "";
                TextBox3.Text  = "";
                TextBox4.Text  = "";
                TextBox5.Text  = "";
                TextBox6.Text  = "";
                TextBox7.Text  = "";
                TextBox8.Text  = "";
                TextBox9.Text  = "";
                TextBox10.Text = "";
                TextBox11.Text = "";
                TextBox12.Text = "";

                DropDownList1.SelectedIndex = 0;
                DropDownList2.SelectedIndex = 0;
                DropDownList3.SelectedIndex = 0;
                DropDownList4.SelectedIndex = 0;
                TextBox1.Focus();

                con.Close();
                if (r == 1)
                {
                    Response.Redirect("Home.aspx");
                }
            }
        }
    }
Exemplo n.º 23
0
        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            try
            {
                ConnectDB cdb = new ConnectDB();
                cdb.connectDataBase();
                SqlConnection con = cdb.connect;
                con.Open();
                SqlCommand com = cdb.command;

                com.CommandText = "SELECT email from [dbo].[user] where email =@email";
                com.Parameters.AddWithValue("@email", TextBox1.Text);

                SqlDataReader rdr;
                rdr = com.ExecuteReader();
                if (!rdr.Read())
                {
                    Label2.Visible = true;
                    TextBox1.Focus();
                }
                con.Close();
            }
            catch (Exception exc)
            {
                Response.Redirect("Error.aspx");
            }
        }
Exemplo n.º 24
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataAdapter da = new SqlDataAdapter
                                ("select * from user_reg", con);
        DataTable dt = new DataTable();

        da.Fill(dt);
        int z  = dt.Rows.Count;
        int z1 = 0;

        for (int i = 0; i < z; i++)
        {
            if (TextBox1.Text == dt.Rows[i][0].ToString() &&
                TextBox2.Text == dt.Rows[i][1].ToString())
            {
                Session.Add("unm", TextBox1.Text);
                if (dt.Rows[i][2].ToString() == "Admin")
                {
                    Response.Redirect("Home.aspx");
                }
                else if (dt.Rows[i][2].ToString() == "User")
                {
                    Response.Redirect("Error.aspx");
                }
                z = 0;
            }
        }
        if (z1 == 0)
        {
            TextBox1.Text = "";
            TextBox2.Text = "";
            TextBox1.Focus();
            Response.Write("Acess Denied");
        }
    }
        protected void Button2_Click(object sender, EventArgs e)
        {
            FuncionarioFundevi funcionario = new FuncionarioFundevi();

            funcionario = (FuncionarioFundevi)Session["funcionarioEditar"];
            if (!TextBox1.Equals("") && !tb1.Equals(""))
            {
                funcionario.nombre = TextBox1.Text;

                Double salario    = 0;
                String txtSalario = tb1.Text.Replace(".", ",");
                if (Double.TryParse(txtSalario, out salario))
                {
                    tb1.Text = salario.ToString();
                }

                funcionario.salario = salario;
                if (funcionariosFundeviServicios.EditarFuncionario(funcionario))
                {
                    String url = Page.ResolveUrl("~/Planilla/AdministrarFuncionarioFundevi.aspx");
                    Response.Redirect(url);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "toastr.error('" + "No se pudo actualizar la información del funcionario" + "');", true);
                }
            }
        }
Exemplo n.º 26
0
    // 保存视频信息
    protected void Button1_Click1(object sender, EventArgs e)
    {
        //验证输入
        if (TextBox1.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请输入视频名称');</script>");
            TextBox1.Focus();
            return;
        }
        if (pic.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请上传视频');</script>");
            return;
        }
        if (TextBox2.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请上传视频截图');</script>");
            return;
        }

        string filename = Hidden1.Value;
        int    i        = this.pic.Text.LastIndexOf(".");
        string newname  = this.pic.Text.Substring(i);//获取文件的扩展名

        string sql = "insert into Video(VideoName,VideoDs,VideoPath,Ename,FileName,Photo)values('" + TextBox1.Text.Trim() + "','" + ArticleContent.Value + "','" + pic.Text + "','" + newname + "','" + filename + "','" + TextBox2.Text + "')";
        bool   b   = SystemMgr.BLL.Common.RunSqlBool(sql);

        Alert.AlertAndRedirect("添加成功继续添加", "AddVideo.aspx");
    }
Exemplo n.º 27
0
 protected void btsua_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim().Length == 0)
     {
         MessageBox.Show("Bạn phải nhập Phòng Ban!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TextBox1.Focus();
         return;
     }
     if (TextBox2.Text.Trim().Length == 0)
     {
         MessageBox.Show("Bạn phải nhập Tên Phòng Ban!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TextBox2.Focus();
         return;
     }
     if (MessageBox.Show("Bạn có muốn sửa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         SqlConnection con = new SqlConnection("Data Source=ADMIN\\VIEWSOINC;Initial Catalog=Gioithieutintuc;Integrated Security=True");
         SqlCommand    cmd = new SqlCommand("update ChuDe set ChuDeID='" + TextBox1.Text + "',TenCD='" + TextBox2.Text + "'where ChuDeID='" + TextBox1.Text + "'", con);
         con.Open();            // mo ket noi
         cmd.ExecuteNonQuery(); // thuc thi
         con.Close();
         Loadbang();
         txbhienthi.Text = "Bạn đã sửa thành công!";
     }
 }
Exemplo n.º 28
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(TextBox1.Text) && String.IsNullOrEmpty(TextBox2.Text))
            {
                TextBox1.Focus();
            }
            else
            {
                Register   key     = new Register();
                Securehash sbuffer = new Securehash();
                string     usrname = sbuffer.Guid(TextBox1.Text);
                if (key.KeyFsequenceAll(TextBox1.Text).Tables[0].Rows[0][1].ToString().Equals(TextBox1.Text, StringComparison.Ordinal))    //compare->guid(username{textbox})|username from dataset
                {
                    //enters us username exists

                    if (AESThenHMAC.SimpleDecryptWithPassword(key.KeyFsequence(TextBox1.Text).ToString(), sbuffer.Guid(TextBox2.Text)).Equals(TextBox2.Text, StringComparison.Ordinal))
                    {
                        TextBox1.Text = "success";
                    }
                    else
                    {
                        TextBox1.Text = "failed";
                    }
                }
                else
                {
                    TextBox1.Text = key.KeyFsequenceAll(TextBox1.Text).Tables[0].Rows[0][1].ToString();
                }
            }
        }
Exemplo n.º 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if(!IsPostBack)
     {
         TextBox1.Focus();
     }
 }
Exemplo n.º 30
0
    protected void rdoview_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (rdoview.SelectedValue == "Date")
        {
            txtfromdate.Focus();
            TextBox1.Text = "";
            TextBox2.Text = "";

            pnldate.Visible          = true;
            pnlgcnno.Visible         = false;
            LocalGodown.ReportSource = null;
        }
        else if (rdoview.SelectedValue == "GCNNO")
        {
            TextBox1.Focus();
            TextBox1.TabIndex  = 1;
            TextBox2.TabIndex  = 2;
            btnreport.TabIndex = 3;

            txtfromdate.Text = "";
            txttodate.Text   = "";

            pnlgcnno.Visible         = true;
            pnldate.Visible          = false;
            LocalGodown.ReportSource = null;
        }
    }