protected void LinkButton2_Click(object sender, EventArgs e) { LinkButton lb = sender as LinkButton; int count = Convert.ToInt32(lb.ValidationGroup); //这个是点击的行的索引 也就是行数 Label a = (Label)DataList1.Items[count].FindControl("UIDLabel"); Label b = (Label)DataList1.Items[count].FindControl("OperateLabel"); Label c = (Label)DataList1.Items[count].FindControl("ToIdLabel"); DataAccess da = new DataAccess(); string sqls = "UPDATE Attention SET Feedback = '0' WHERE UID = '" + a.Text + "' and Operate='" + b.Text + "' and ToId=" + c.Text; da.ExecuteSql(sqls); if (b.Text == "申请加入项目") { sqls = "select Name from Item where ItemId=" + c.Text; DataSet ds = da.dataSet(sqls); string ItemName = ds.Tables[0].Rows[0]["Name"].ToString(); string SendUID = Session["UID"].ToString(); string ReceiveUID = a.Text; string Detail = "很遗憾,您未加入我们的项目“" + ItemName + "”,希望您能在这里找到更适合您的项目!"; string SendTime = DateTime.Now.ToString(); sqls = "INSERT INTO Letter VALUES ('" + SendUID + "','" + ReceiveUID + "','" + Detail + "','" + SendTime + "','" + "0')"; da.ExecuteSql(sqls); sqls = "select SendUID from Letter where (SendUID=" + ReceiveUID + ") and (ReceiveUID=" + SendUID + ")"; ds = da.dataSet(sqls); if (ds.Tables[0].Rows.Count == 0) { sqls = "INSERT INTO Letter VALUES ('" + ReceiveUID + "','" + SendUID + "',' ','" + SendTime + "','" + "0')"; da.ExecuteSql(sqls); } alertv un = new alertv(); Response.Write(un.gutAlertUrl("您已拒绝了该用户的申请", "./attention.aspx")); } }
protected void Button7_Click(object sender, EventArgs e) { DataAccess da = new DataAccess(); string RUID = RadioButtonList1.SelectedValue.ToString(); string sqls = "select UID from Ass_User where UID=" + RUID + " And AssId=" + AssId; DataSet ds = da.dataSet(sqls); if (ds.Tables[0].Rows.Count > 0) { sqls = "DELETE FROM Ass_User WHERE UID = " + RUID; da.ExecuteSql(sqls); sqls = "UPDATE Assignment SET ResponsibleUID = " + RUID + " WHERE ResponsibleUID = " + Session["UID"].ToString() + "and AssId=" + AssId; da.ExecuteSql(sqls); } else { sqls = "UPDATE Assignment SET ResponsibleUID = " + RUID + " WHERE ResponsibleUID = " + Session["UID"].ToString() + "AND AssId=" + AssId; da.ExecuteSql(sqls); } string CreateTime = DateTime.Now.ToString(); sqls = "INSERT INTO Ass_User(AssId,UID,CreateTime) VALUES ('" + AssId + "','" + Session["UID"] + "','" + CreateTime + "')"; da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("权限移交成功", "item.aspx")); }
protected void Button1_Click(object sender, EventArgs e) { universal un = new universal(); if (FileUpload1.HasFile) { string savePath = Server.MapPath("~/file/"); //指定上传文件在服务器上的保存路径 //检查服务器上是否存在这个物理路径,如果不存在则创建 if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } savePath = savePath + "\\" + FileUpload1.FileName; FileUpload1.SaveAs(savePath); DataAccess da = new DataAccess(); string CreateTime = DateTime.Now.ToString(); string BelongUID = Session["UID"].ToString(); string FileName = FileUpload1.FileName.ToString(); string BelongItemId = Session["ItemId"].ToString(); string sqls = "INSERT INTO File_ (CreateTime, BelongUID,FileName,BelongItemId) VALUES ('" + CreateTime + "','" + BelongUID + "','" + FileName + "','" + BelongItemId + "')"; da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("上传成功", "file.aspx")); } else { un.Alert("你还没有选择上传文件!", this); } }
protected void Button1_Click(object sender, EventArgs e) { universal un = new universal(); bool Err = true; if (TextBox1.Text == "") { Err = false; un.Alert("项目名不得为空", this); } if (TextBox3.Text == "") { Err = false; un.Alert("项目简介不得为空", this); } if (Err) { string Name = TextBox1.Text; string Intro = TextBox3.Text; string IsPublic = "1"; if (CheckBox2.Checked == true) { IsPublic = "0"; } string Detail = textarea1.Value; string UserNumber = ""; if (TextBox2.Text != "") { UserNumber = TextBox2.Text; } string IconCode = ""; string CreateTime = DateTime.Now.ToString(); foreach (DataListItem item in this.DataList1.Items) { RadioButton RB = (RadioButton)item.FindControl("RB"); Label LB = (Label)item.FindControl("LB"); if (RB.Checked == true) { IconCode = LB.Text; } } string sqls = "INSERT INTO Item (Name, Intro,IsPublic,Detail,UserNumber,IconCode,CreateTime) VALUES ('" + Name + "','" + Intro + "','" + IsPublic + "','" + Detail + "','" + UserNumber + "','" + IconCode + "','" + CreateTime + "')"; DataAccess da = new DataAccess(); da.ExecuteSql(sqls); sqls = "SELECT ItemId FROM Item WHERE Name='" + Name + "' ORDER BY ItemId"; DataSet ds = da.dataSet(sqls); string UID = Session["UID"].ToString(); string ItemId = ds.Tables[0].Rows[0]["ItemId"].ToString(); sqls = "INSERT INTO Item_User VALUES('" + UID + "','" + ItemId + "','1','','1')"; da.ExecuteSql(sqls); sqls = "INSERT INTO List(Name,Array,BelongItem) VALUES('默认列表','1','" + ItemId + "')"; da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("创建成功", "../item/item-list.aspx")); } }
protected void Button4_Click(object sender, EventArgs e) { string Name = TextBox1.Text; string Remark = TextArea1.Value; string BeginTime = TextBox2.Text; string EndTime = TextBox3.Text; string IsImportant = CheckBox1.Checked.ToString(); string sqls = "UPDATE Assignment SET Name = '" + Name + "', Remark = '" + Remark + "', BeginTime = '" + BeginTime + "', EndTime = '" + EndTime + "', IsImportant = '" + IsImportant + "' WHERE AssId = '" + AssId + "'"; da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("修改成功", "ass-edit.aspx?AssId=" + Request.QueryString["AssId"].ToString())); }
protected void Button1_Click(object sender, EventArgs e) { universal un = new universal(); bool Err = true; if (TextBox1.Text == "") { Err = false; un.Alert("项目名不得为空", this); } if (TextBox3.Text == "") { Err = false; un.Alert("项目简介不得为空", this); } if (Err) { string Name = TextBox1.Text; string Intro = TextBox3.Text; string IsPublic = "1"; if (CheckBox2.Checked == true) { IsPublic = "0"; } string Detail = textarea1.Value; string UserNumber = ""; if (TextBox2.Text != "") { UserNumber = TextBox2.Text; } string IconCode = ""; string CreateTime = DateTime.Now.ToString(); foreach (DataListItem item in this.DataList1.Items) { RadioButton RB = (RadioButton)item.FindControl("RB"); Label LB = (Label)item.FindControl("LB"); if (RB.Checked == true) { IconCode = LB.Text; } } string sqls = "Update Item SET Name='" + Name + "', Intro='" + Intro + "',IsPublic='" + IsPublic + "',Detail='" + Detail + "',UserNumber='" + UserNumber + "',IconCode='" + IconCode + "',CreateTime='" + CreateTime + "' where ItemId=" + Session["ItemId"].ToString(); DataAccess da = new DataAccess(); da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("修改成功", "../item/item-list.aspx")); } }
protected void Button2_Click(object sender, EventArgs e) { DataAccess da = new DataAccess(); string ItemId = Request.QueryString["ItemId"].ToString(); string sqls = "select UID from Item_User where Limit=1 and ItemId=" + ItemId; DataSet ds = da.dataSet(sqls); string ToUID = ds.Tables[0].Rows[0]["UID"].ToString(); string Detail = textarea1.Value; string CreateTime = DateTime.Now.ToString(); sqls = "INSERT INTO Attention(UID,ToUID,Operate,Detail,ToId,CreateTime) VALUES ('" + Session["UID"].ToString() + "','" + ToUID + "','申请加入项目','" + Detail + "','" + ItemId + "','" + CreateTime + "')"; da.ExecuteSql(sqls); /*universal un = new universal(); * un.Alert("已提交申请,请耐心等候项目负责人的回复", this); * Response.RedirectPermanent("~/market/Default.aspx");*/ alertv al = new alertv(); Response.Write(al.gutAlertUrl("已提交申请,请耐心等候项目负责人的回复", "Default.aspx")); }
protected void Button1_Click(object sender, EventArgs e) { universal un = new universal(); bool Err = true; if (rcm.Text == "") { Err = false; un.Alert("日程名不得为空", this); } if (st.Text == "") { Err = false; un.Alert("开始时间不得为空", this); } if (et.Text == "") { Err = false; un.Alert("结束时间不得为空", this); } DateTime sT = DateTime.Parse(st.Text); DateTime eT = DateTime.Parse(et.Text); TimeSpan ts = sT.Subtract(eT); if (ts.Days > 0) { Err = false; un.Alert("错误:结束时间早于开始时间", this); } if (Err) { DataAccess da = new DataAccess(); string Name = rcm.Text; string Remark = xq.Text; string BeginTime = st.Text; string EndTime = et.Text; string Priority = ""; if (RadioButton1.Checked == true) { Priority = "0"; } else if (RadioButton2.Checked == true) { Priority = "1"; } else if (RadioButton3.Checked == true) { Priority = "2"; } string AssId = ""; string UID = Session["UID"].ToString(); string CreateTime = DateTime.Now.ToString(); string sqls = ""; if (RadioButtonList1.SelectedValue != null) { AssId = RadioButtonList1.SelectedValue; sqls = "INSERT INTO Schedule (Name,Remark,BeginTime,EndTime,Priority,AssId,UID,CreateTime) VALUES ('" + Name + "','" + Remark + "','" + BeginTime + "','" + EndTime + "','" + Priority + "','" + AssId + "','" + UID + "','" + CreateTime + "')"; } if (xq.Text == "") { sqls = "INSERT INTO Schedule (Name,BeginTime,EndTime,Priority,AssId,UID,CreateTime) VALUES ('" + Name + "','" + BeginTime + "','" + EndTime + "','" + Priority + "','" + AssId + "','" + UID + "','" + CreateTime + "')"; if (RadioButtonList1.SelectedValue == null) { sqls = "INSERT INTO Schedule (Name,BeginTime,EndTime,Priority,UID,CreateTime) VALUES ('" + Name + "','" + BeginTime + "','" + EndTime + "','" + Priority + "','" + UID + "','" + CreateTime + "')"; } } else { if (RadioButtonList1.SelectedValue == null) { sqls = "INSERT INTO Schedule (Name,Remark,BeginTime,EndTime,Priority,UID,CreateTime) VALUES ('" + Name + "','" + Remark + "','" + BeginTime + "','" + EndTime + "','" + Priority + "','" + UID + "','" + CreateTime + "')"; } } da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("创建成功", "../item/item-list.aspx")); } }
protected void Button1_Click(object sender, EventArgs e) { int Error_ = 0; int NameLength = User_Name.Text.Length; int GenderBit = 0; Regex r = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); if (User_Name.Text == "") { NameY.ForeColor = System.Drawing.Color.Red; NameY.Text = "用户名不得为空"; Error_ = 1; } if (NameLength > 16) { NameY.ForeColor = System.Drawing.Color.Red; NameY.Text = "用户名过长"; Error_ = 1; } if (User_Password.Text == "") { PasswordY1.ForeColor = System.Drawing.Color.Red; PasswordY1.Text = "密码不得为空"; Error_ = 1; } if (User_Password.Text != User_Password2.Text) { PasswordY2.ForeColor = System.Drawing.Color.Red; PasswordY2.Text = "两次密码输入不一致"; Error_ = 1; } if (r.IsMatch(User_Email.Text)) { EmailY.Text = "邮箱格式正确"; } else { EmailY.ForeColor = System.Drawing.Color.Red; EmailY.Text = "邮箱格式错误"; Error_ = 1; } if (Gender1.Checked == Gender2.Checked) { Error_ = 1; } else { if (Gender1.Checked == true) { GenderBit = 1; } } DataAccess da = new DataAccess(); string sqls = "SELECT Name FROM dbo.User_ WHERE Name='" + User_Name.Text + "'"; DataSet ds = da.dataSet(sqls); if (ds.Tables[0].Rows.Count != 0) { if (User_Name.Text == ds.Tables [0].Rows [0]["Name"].ToString()) { Error_ = 1; NameY.ForeColor = System.Drawing.Color.Red; NameY.Text = "用户名重复"; } } if (Error_ == 0) { string Name = User_Name.Text; string Password = User_Password.Text; string Gender = GenderBit.ToString(); string Email = User_Email.Text; sqls = "insert into User_ (Name,Password,Gender,Email) VALUES ('" + Name + "','" + Password + "','" + Gender + "','" + Email + "')"; da.ExecuteSql(sqls); alertv al = new alertv(); Response.Write(al.gutAlertUrl("注册成功", "Login.aspx")); } }