bc... []

service.aspx.cs ( File view )

  • By wang__meng 2014-10-24
  • View(s):2050
  • Download(s):29
  • Point(s): 1
			using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class Account_Register : System.Web.UI.Page
{


    protected void Page_Load(object sender, EventArgs e)
    {

      
        
        string rnum = Request.QueryString["RoomNum"];
        repairtime.Text = DateTime.Now.ToString();
        roomnum.Text = rnum;
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = "Data Source=WANGMENG-PC\\SQLEXPRESS;Initial Catalog=HotelRoom;Integrated Security=True";
        SqlCommand cmm = new SqlCommand();
        cmm.Connection = conn;
        conn.Open();
        cmm.CommandText = "SELECT  [repaircause]  FROM [HotelRepair] where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        SqlDataReader sqlread = cmm.ExecuteReader();
            try
            {

                if  (sqlread.Read())
                {

                       repaircause.Text =sqlread["repaircause"].ToString();
                
}



            
}
            catch
            {

              Response.Write("SELECT  [repaircause]  FROM [HotelRepair] where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'");

            
}
            //DropDownList1.SelectedIndex = 0;

        
}
       
       
    protected void  Button1_Click(object sender, EventArgs e)
{

    SqlConnection conn = new SqlConnection();
    conn.ConnectionString = "Data Source=WANGMENG-PC\\SQLEXPRESS;Initial Catalog=HotelRoom;Integrated Security=True";
    SqlCommand cmm = new SqlCommand();
    cmm.Connection = conn;
    conn.Open();
    string srepairname = repairname.Text;
    string srepairphone = repairphone.Text;
    string srepairsug = repairsug.Text;
    string srepaircase = repaicase.Text;
    try
    {


        //cmm.CommandText = "insert into HotelRepair(repairname,repairphone,remark,repaircase,repairtime)" + " values('" + srepairname + "'," + "'" +
        //srepairphone + "'," + "'" + srepairsug + "'," + "'" + srepaircase + "'," + "'" + DateTime.Now.ToString() + "')";
        cmm.CommandText = "update HotelRepair set repairname='" + srepairname + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update HotelRepair set repairphone='" + srepairphone + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update HotelRepair set remark='" + srepairsug + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update HotelRepair set repaircase='" + srepaircase + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update HotelRepair set repairtime='" + DateTime.Now.ToString() + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update HotelRepair set ifrepair='1' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update Room set state='干净房' where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'";
        cmm.ExecuteNonQuery();
        cmm.CommandText = "update Room set Remark='' where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'";
        cmm.ExecuteNonQuery();
        Response.Write("<script language=javascript >alert('维修成功');<");
        Response.Write("/Script>");

    
}
    catch
    {

        Response.Write( "update HotelRepair set repairname='" + srepairname + "' where [RoomNum] =" + "'" + Request.QueryString["RoomNum"].ToString() + "' and [ifrepair] ='0'");
        conn.Close();
    
}

}

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

        repairname.Text = DropDownList1.SelectedValue.ToString();
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = "Data Source=WANGMENG-PC\\SQLEXPRESS;Initial Catalog=HotelRoom;Integrated Security=True";
        SqlCommand cmm = new SqlCommand();
        cmm.Connection = conn;
        conn.Open();
        cmm.CommandText = "SELECT DISTINCT [repairname],[repairphone] FROM [HotelRepair] where repairname =" + "'" + DropDownList1.SelectedValue.ToString() + "'" + " order by [repairname]";
        SqlDataReader sqlread = cmm.ExecuteReader();
        try
        {

            while (sqlread.Read())
            {

                repairphone.Text = sqlread["repairphone"].ToString();

            
}

            sqlread.Close();

        
}
        catch
        {

            Response.Write("SELECT DISTINCT [repairname],[repairphone] FROM [HotelRepair] where repairname =" + "'" + DropDownList1.SelectedValue.ToString() + "'" + " order by [repairname]");
            //SqlDataReader sqlread = cmm.ExecuteReader();
            Response.Write("<table><tr><td>电话号码</td><td>证件号</td></tr>");
            while (sqlread.Read())
            {

                Response.Write("<tr>");
                Response.Write("<td>" + sqlread["uesrphone"].ToString() + "<td>");
                Response.Write("<td>" + sqlread["userID"].ToString() + "<td>");
                Response.Write("<tr>");

            
}
            Response.Write("</table>");
        
}
    
}

}




    //protected void Button1_Click(object sender, EventArgs e)
    //{

    //    SqlConnection conn=new SqlConnection();
    //    conn.ConnectionString="Data Source=WANGMENG-PC\\SQLEXPRESS;Initial Catalog=HotelRoom;Integrated Security=True";
    //    SqlCommand cmm = new SqlCommand();
    //    cmm.Connection = conn;
    //    conn.Open();
    //         string lab = DateTime.Now.ToShortDateString() + roomnum.Text.ToString();
    //         string rRnum = roomnum.Text;
    //         string sname = UserName.Text;
    //         string sphone  = Email.Text;
    //         string sid  = Password.Text;
    //         string sint = DateTime.Now.ToString();
    //         string sout = DateTime.Now.AddDays(day).ToString();
    //         int  scase = int.Parse(usercase.Text);
    //    try
    //    {

 
    //        cmm.CommandText = "insert into HotelUser(RoomNum,username,uesrphone,userID,userintime,userouttime,usercase)" + " values('"  + rRnum + "'," + "'" +
    //        sname + "'," + "'" + sphone + "'," + "'" + sid + "'," + "'" + sint + "'," + "'" + sout + "'," + "'" + scase.ToString() + "')";
    //       // Response.Write(cmm.CommandText.ToString());
    //        cmm.ExecuteNonQuery();
    //       //Response.Write("写入成功");
    //        cmm.CommandText = "update Room set state='已住' where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'";
    //        cmm.ExecuteNonQuery();
    //        cmm.CommandText = "update Room set  opnum='2'  where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'";
    //        cmm.ExecuteNonQuery();
    //        cmm.CommandText = "update Room set  opera='去结帐' where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'";
    //        cmm.ExecuteNonQuery();
    //        Response.Write("<script language=javascript >alert('入住成功');<");
    //        Response.Write("/Script>");
    //        //Response.Write("");
    //       // Response.Write("<script>window.location='Default.aspx'</script>");

    //    
}
    //    catch {
 
    //        Response.Write("update Room set state='已住' opnum='2' opera='去结帐' where RoomNum=" + "'" + Request.QueryString["RoomNum"] + "'");
    //        conn.Close();
    //    
}
      
 

    //
}
    //protected void uottimeDownList_SelectedIndexChanged(object sender, EventArgs e)
    //{

    //    userintime.Text = DateTime.Now.ToString();
    //    int day = int.Parse(uottimeDownList.SelectedValue.ToString());
    //    userouttime.Text = DateTime.Now.AddDays(day).ToString();
        
    //
}
    //protected void usernameDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    //{

    //    UserName.Text = usernameDropDownList.SelectedValue.ToString();
    //    SqlConnection conn = new SqlConnection();
    //    conn.ConnectionString = "Data Source=WANGMENG-PC\\SQLEXPRESS;Initial Catalog=HotelRoom;Integrated Security=True";
    //    SqlCommand cmm = new SqlCommand();
    //    cmm.Connection = conn;
    //    conn.Open();
    //    cmm.CommandText = "SELECT DISTINCT [userID],[uesrphone],[userintime] FROM [HotelUser] where username =" + "'" + usernameDropDownList.SelectedValue.ToString() + "'" + " order by [userintime]";
    //    SqlDataReader sqlread = cmm.ExecuteReader();
    //    try
    //    {

    //        while (sqlread.Read())
    //        {

    //            Email.Text = sqlread["uesrphone"].ToString();
    //            Password.Text = sqlread["userID"].ToString();

    //        
}
            
          
    
    //    
}
    //    catch
    //    {

    //      //  Response.Write("SELECT DISTINCT [userID],[uesrphone] FROM [HotelUser] where username =" + "'" + usernameDropDownList.SelectedValue.ToString() + "'");
    //        //SqlDataReader sqlread = cmm.ExecuteReader();
    //        Response.Write("<table><tr><td>电话号码</td><td>证件号</td></tr>");
    //        while (sqlread.Read())
    //        {

    //            Response.Write("<tr>");
    //            Response.Write("<td>" + sqlread["uesrphone"].ToString()+"<td>");
    //            Response.Write("<td>" + sqlread["userID"].ToString()+ "<td>");
    //            Response.Write("<tr>");

    //        
}
    //        Response.Write("</table>");
    //    
}
            
    //
}


			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
HotelRoom.bak3.41 MB2012-04-06 13:12
01.96 kB
About.aspx821.00 B2012-04-05 18:52
About.aspx.cs279.00 B2012-03-30 12:49
01.96 kB
ChangePassword.aspx4.33 kB2012-03-30 12:49
ChangePassword.aspx.cs296.00 B2012-03-30 12:49
ChangePasswordSuccess.aspx494.00 B2012-03-30 12:49
ChangePasswordSuccess.aspx.cs303.00 B2012-03-30 12:49
Login.aspx2.98 kB2012-03-30 12:49
Login.aspx.cs412.00 B2012-03-30 12:49
Register.aspx5.55 kB2012-03-30 12:49
Register.aspx.cs814.00 B2012-03-30 12:49
Web.config330.00 B2012-03-30 12:49
01.96 kB
HotelRoomDataSet.xsd12.72 kB2012-04-03 23:44
01.96 kB
ASPNETDB.MDF10.00 MB2012-04-06 13:19
aspnetdb_log.ldf504.00 kB2012-04-06 13:19
Default.aspx2.90 kB2012-04-06 12:56
Default.aspx.cs472.00 B2012-03-31 23:30
Global.asax1.44 kB2012-03-30 21:27
01.96 kB
1.jpg108.61 kB2012-04-03 16:55
10.jpg162.23 kB2012-04-03 17:00
11.jpg151.32 kB2012-04-03 17:00
12.jpg76.01 kB2012-04-03 17:00
2.jpg59.00 kB2012-04-03 16:52
3.jpg49.92 kB2012-04-03 17:03
4.jpg71.51 kB2012-04-03 17:04
5.jpg32.66 kB2012-04-03 16:52
6.jpg64.42 kB2012-04-03 16:52
7.jpg49.27 kB2012-04-03 17:03
8.jpg42.26 kB2012-04-03 16:53
9.jpg91.42 kB2012-04-03 16:52
01.96 kB
Addmanage.aspx3.10 kB2012-04-05 13:34
Addmanage.aspx.cs1.71 kB2012-04-05 13:24
Addmember.aspx5.62 kB2012-04-04 23:13
Addmember.aspx.cs2.27 kB2012-04-04 22:41
check-out.aspx4.71 kB2012-04-02 23:17
check-out.aspx.cs6.25 kB2012-04-05 22:49
expend-forms.aspx2.98 kB2012-04-04 22:24
expend-forms.aspx.cs407.00 B2012-04-03 23:40
manage.aspx4.34 kB2012-04-04 21:28
manage.aspx.cs7.95 kB2012-04-05 22:41
member-forms.aspx2.79 kB2012-04-06 12:02
member-forms.aspx.cs407.00 B2012-04-03 23:40
member-manage.aspx6.47 kB2012-04-04 23:14
member-manage.aspx.cs4.94 kB2012-04-04 22:46
Register.aspx8.33 kB2012-04-04 15:31
Register.aspx.cs8.01 kB2012-04-06 12:44
report-forms.aspx2.80 kB2012-04-04 22:38
report-forms.aspx.cs407.00 B2012-04-03 23:40
service.aspx4.59 kB2012-04-04 20:49
service.aspx.cs9.93 kB2012-04-05 13:35
01.96 kB
jquery-1.4.1.js164.84 kB2010-05-04 06:45
jquery-1.4.1.min.js70.24 kB2010-05-04 06:45
jquery-1.4.1-vsdoc.js234.21 kB2010-05-04 06:45
Site.master3.89 kB2012-04-06 12:10
Site.master.cs290.00 B2012-03-30 12:49
Site2.master3.89 kB2012-04-06 12:11
Site2.master.cs290.00 B2012-03-30 12:49
01.96 kB
Site.css4.14 kB2012-04-05 18:42
Web.config3.63 kB2012-04-03 23:42
+?-???-+??-+.doc1.67 MB2012-04-06 13:00
+=????+_.exe19.58 MB2012-04-05 22:59
...

service.aspx.cs (27.84 MB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D