protected void btnSure_Click(object sender, EventArgs e) { foreach (GridViewRow row in GridView1.Rows) { string id = Convert.ToString(GridView1.DataKeys[row.RowIndex].Value); TextBox listNum = (TextBox)row.FindControl("listNum"); _ModuleClass.AddParameter("listNum", listNum.Text); _ModuleClass.UpdateById(id); } Show(); }
protected void Button1_Click(object sender, EventArgs e) { DataLayer dataLayer = new DataLayer(); DataRow row = dataLayer.Login(User.Identity.Name, Password.Text); if (row == null) { My.WebForm.doJavaScript("alert('密碼錯誤')"); return; } Person person = new Person(); EasyDataProvide StudentContactBookMessage = new EasyDataProvide("StudentContactBookMessage"); StudentContactBookMessage.AddParameter("studentContactBook_id", ViewState["studentContactBook_id"].ToString()); //先刪除 StudentContactBookMessage.AddParameter("studentContactBook_id", ViewState["studentContactBook_id"].ToString()); StudentContactBookMessage.Delete("studentContactBook_id=@studentContactBook_id and Role=2"); //後新增 StudentContactBookMessage.AddParameter("student_id", Request["people_id"]); StudentContactBookMessage.AddParameter("people_id", person.people_id); StudentContactBookMessage.AddParameter("Role", "2"); StudentContactBookMessage.AddParameter("article", txtArticle.Text); StudentContactBookMessage.AddParameter("contactBookDate", ViewState["date"].ToString()); StudentContactBookMessage.Insert(); EasyDataProvide StudentContactBook = new EasyDataProvide("StudentContactBook"); StudentContactBook.AddParameter("isSign", "true"); StudentContactBook.UpdateById(ViewState["studentContactBook_id"].ToString()); My.WebForm.doJavaScript(String.Format("alert('新增成功');location.href='ContactBook_ForParent.aspx?people_id={0}'", Request["people_id"])); }
protected void btnEdit_Click(object sender, EventArgs e) { _ModulePictures.SetPageFormQuest(); //處理上傳圖片 if (ddlPic.SelectedValue == "上傳圖片") { if (fuPic.HasFile) { if (fuPic.PostedFile.ContentType.IndexOf("image") == -1) { My.WebForm.doJavaScript("alert('檔案型態錯誤!');"); return; } //取得副檔名 string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1]; //新檔案名稱 string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName))); _ModulePictures.AddParameter("picUrl", fileName); //產生縮圖 My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images/"), "S", 142, 89); } else { My.WebForm.doJavaScript("alert('沒有上傳檔案');"); return; } } _ModulePictures.UpdateById(Request["ID"]); string Publish = "_News_Pictures.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + Request["publishID"]; My.WebForm.doJavaScript(String.Format("parent.tb_remove();parent.location='{0}';", Publish)); }
protected void btnEdit_Click(object sender, EventArgs e) { //宣告檔案上傳設定 FileUploadSetup fus = new FileUploadSetup(); fus.name = "fileUrl"; fus.fileType = FileUploadSetup.UpfileType.File; fus.allowNoFile = true; _ModuleFiles.FileUploadSetups.Add(fus); try //捕抓自訂錯誤 { _ModuleFiles.SetPageFormQuest(); } catch (Exception ex1) { lblError.Text = ex1.Message; return; } //處理上傳檔案 if (ddlFile.SelectedValue == "檔案連結") { _ModuleFiles.AddParameter("fileUrl", fileUrlPath.Text); } _ModuleFiles.UpdateById(Request["ID"].ToString()); string Publish = "_News_Files.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + Request["publishID"]; My.WebForm.doJavaScript(String.Format("parent.tb_remove();parent.location='{0}';", Publish)); }
protected void InsertButton_Click(object sender, EventArgs e) { string areaID = ""; string telID = ""; //新增或修改電話 _telephone.AddParameter("areaCode", areaCode.Value); _telephone.AddParameter("numberCode", numberCode.Value); if (string.IsNullOrEmpty(ViewState["tel"].ToString())) { telID = _telephone.InsertReturnValue(); } else { _telephone.UpdateById(ViewState["tel"].ToString()); telID = ViewState["tel"].ToString(); } //新增或修改地址 _address.AddParameter("city", Request["city"]); _address.AddParameter("division", Request["division"]); _address.AddParameter("zip", Request["zip"]); _address.AddParameter("address", address.Value); if (string.IsNullOrEmpty(ViewState["address"].ToString())) { areaID = _address.InsertReturnValue(); } else { _address.UpdateById(ViewState["address"].ToString()); areaID = ViewState["address"].ToString(); } //更新Pepole EasyDataProvide People = new EasyDataProvide("People"); People.SetPlaceHolderFormQuest(); People.AddParameter("address_id", telID); People.AddParameter("telephone_id", areaID); People.UpdateById(Request["id"]); //更新teacher _teacher.AddParameter("rank", rank.SelectedValue); _teacher.UpdateById(Request["id"]); //更新People_School _people_School.AddParameter("people_id", Request["id"]); _people_School.AddParameter("school_id", ddlSchool.SelectedValue); _people_School.Update("people_id=@people_id"); //更新帳號 _account.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5")); _account.AddParameter("emailAddress", emailAddress.Text); _account.AddParameter("people_id", Request["id"]); _account.UpdateById(Request["id"]); My.WebForm.doJavaScript("alert('修改成功');location.href='Teacher_List.aspx'"); }
protected void UpdateButton_Click(object sender, EventArgs e) { EasyDataProvide InputData = new EasyDataProvide("InputData"); InputData.SetPlaceHolderFormQuest(); InputData.UpdateById(Request["ID"]); Response.Redirect("Input_list.aspx?ModuleID=" + Request["ModuleID"]); }
protected void btnEdit_Click(object sender, EventArgs e) { _ModuleLinks.SetPageFormQuest(); _ModuleLinks.UpdateById(Request["ID"]); string Publish = "_News_Links.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + Request["publishID"]; My.WebForm.doJavaScript(String.Format("parent.tb_remove();parent.location='{0}';", Publish)); }
protected void btnSend_Click(object sender, EventArgs e) { EasyDataProvide ContactBook = new EasyDataProvide("ContactBook"); ContactBook.AddParameter("activity", "true"); ContactBook.UpdateById(ViewState["id"].ToString()); ShowContact(); ShowStudents(); My.WebForm.doJavaScript("alert('聯絡簿已經送出!');"); }
protected void btnADD_Click(object sender, EventArgs e) { string RoleID = Request["ID"].ToString(); EasyDataProvide Role = new EasyDataProvide("Role"); Role.SetPlaceHolderFormQuest(); Role.AddParameter("permission", PermissionUserControl2.permissionString); Role.UpdateById(RoleID); Response.Redirect("Role_list.aspx?ModuleID=A02"); }
protected void btnSure_Click(object sender, EventArgs e) { EasyDataProvide GradeTeacher = new EasyDataProvide("GradeTeacher"); foreach (GridViewRow row in gvList.Rows) { string ID = gvList.DataKeys[row.RowIndex].Value.ToString(); DropDownList ddlClassify = (DropDownList)row.FindControl("ddlClassify"); GradeTeacher.AddParameter("classify", ddlClassify.SelectedValue); GradeTeacher.UpdateById(ID); } My.WebForm.doJavaScript("alert('設定成功');location.href='" + Request.Url.ToString() + "'"); }
protected void UpdateButton_Click(object sender, EventArgs e) { _Member.SetPlaceHolderFormQuest(); if (!string.IsNullOrEmpty(Cpassword.Text)) { _Member.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(Cpassword.Text, "MD5")); } string premissionString = PermissionUserControl1.permissionString; _Member.AddParameter("Permission", premissionString); _Member.UpdateById(Request["ID"]); Response.Redirect("Account_list.aspx?ModuleID=" + Request["ModuleID"]); }
protected void InsertButton_Click(object sender, EventArgs e) { //更新帳號資料 if (!string.IsNullOrEmpty(password.Text)) { _Customer.AddParameter("password", password.Text); } _Customer.AddParameter("name", name.Text); _Customer.AddParameter("aliasName", aliasName.Text); _Customer.AddParameter("gender", gender.SelectedValue); _Customer.AddParameter("emailAddress", emailAddress.Text); _Customer.AddParameter("birthday", birthday.Text); _Customer.AddParameter("areaCode", areaCode.Value); _Customer.AddParameter("numberCode", numberCode.Value); _Customer.AddParameter("cellphone", cellphone.Text); _Customer.AddParameter("city", Request["city"]); _Customer.AddParameter("division", Request["division"]); _Customer.AddParameter("zip", Request["zip"]); _Customer.AddParameter("address", address.Value); _Customer.UpdateById(Request["id"]); My.WebForm.doJavaScript("alert('修改成功!');location.href='Customer_List.aspx?ModuleID=" + Request["ModuleID"] + "'"); }
protected void InsertButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(article.Text)) { My.WebForm.doJavaScript("alert('詳細說明不可以空白.');"); return; } //if (shortDescription.Text.Length >=500) //{ // My.WebForm.doJavaScript("alert('簡單說明不可以超過500個字.');"); // return; //} EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish"); ModulePublish.SetPlaceHolderFormQuest(); string strUserData = ((FormsIdentity)(HttpContext.Current.User.Identity)).Ticket.UserData; ModulePublish.AddParameter("updater", strUserData); ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString()); ModulePublish.UpdateById(Request["ID"]); EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents"); ModuleContents.AddParameter("article", article.Text); ModuleContents.UpdateById(ViewState["articleID"].ToString()); Response.Redirect(String.Format("i-post.aspx?&page={0}", Request["page"])); }
protected void InsertButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(article.Text)) { My.WebForm.doJavaScript("alert('詳細說明不可以空白.');"); return; } //if (shortDescription.Text.Length >=500) //{ // My.WebForm.doJavaScript("alert('簡單說明不可以超過500個字.');"); // return; //} Person person = new Person(); EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish"); ModulePublish.SetPlaceHolderFormQuest(); //處理上傳檔案 if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile) { //取得副檔名 string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1]; //新檔案名稱 string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName))); ModulePublish.AddParameter("fileUrl", fileName); } //處理上傳圖片 if (fuPic.HasFile) { if (fuPic.PostedFile.ContentType.IndexOf("image") == -1) { My.WebForm.doJavaScript("alert('檔案型態錯誤!');"); return; } //取得副檔名 string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1]; //新檔案名稱 string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName))); My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images/"), "S", 127, 127); ModulePublish.AddParameter("picUrl", fileName); } ModulePublish.AddParameter("classID", ddlClass1.SelectedValue); ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue); ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text); ModulePublish.AddParameter("updater", person.name); ModulePublish.AddParameter("updaterUnit", person.organization); ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString()); //不填結束日期時,設定一個800年後的日期 if (string.IsNullOrEmpty(endDate.Text)) { ModulePublish.AddParameter("endDate", "2800/1/1"); } ModulePublish.UpdateById(Request["ID"]); EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents"); ModuleContents.AddParameter("article", article.Text); ModuleContents.UpdateById(ViewState["articleID"].ToString()); Response.Redirect(String.Format("News_List.aspx?ModuleID={0}&page={1}", Request["ModuleID"], Request["page"])); }
protected void InsertButton_Click(object sender, EventArgs e) { string areaID = ""; string telID = ""; //新增或修改電話 _telephone.AddParameter("areaCode", areaCode.Value); _telephone.AddParameter("numberCode", numberCode.Value); if (string.IsNullOrEmpty(ViewState["tel"].ToString())) { telID = _telephone.InsertReturnValue(); } else { _telephone.UpdateById(ViewState["tel"].ToString()); telID = ViewState["tel"].ToString(); } //新增或修改地址 _address.AddParameter("city", Request["city"]); _address.AddParameter("division", Request["division"]); _address.AddParameter("zip", Request["zip"]); _address.AddParameter("address", address.Value); if (string.IsNullOrEmpty(ViewState["address"].ToString())) { areaID = _address.InsertReturnValue(); } else { _address.UpdateById(ViewState["address"].ToString()); areaID = ViewState["address"].ToString(); } //更新Pepole EasyDataProvide People = new EasyDataProvide("People"); People.SetPlaceHolderFormQuest(); People.AddParameter("address_id", telID); People.AddParameter("telephone_id", areaID); string Path = GetMyPath(); string filePic = ""; if (fuMyPhoto.HasFile) { string PicExtension = fuMyPhoto.FileName.Split('.')[fuMyPhoto.FileName.Split('.').Length - 1]; //新檔案名稱 filePic = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, PicExtension); fuMyPhoto.SaveAs(String.Format("{0}/{1}", Path, filePic)); My.WebForm.GenerateThumbnailImage(filePic, fuMyPhoto.PostedFile.InputStream, Path, "M", 90, 85); My.WebForm.GenerateThumbnailImage(filePic, fuMyPhoto.PostedFile.InputStream, Path, "S", 54, 61); People.AddParameter("myPhoto", filePic); } People.UpdateById((new Person()).people_id); //更新帳號 _account.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5")); _account.AddParameter("emailAddress", emailAddress.Text); _account.AddParameter("people_id", (new Person()).people_id); _account.UpdateById((new Person()).people_id); My.WebForm.doJavaScript("alert('修改成功');location.href='Person_DataEdit.aspx'"); }
//private void ShowOrg() //{ // EasyDataProvide UnitName = new EasyDataProvide("UnitName"); // DataTable dt = UnitName.GetAllData(); // ddlOrg.DataSource = dt; // ddlOrg.DataBind(); //} protected void InsertButton_Click(object sender, EventArgs e) { Person person = new Person(); EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish"); ModulePublish.SetPlaceHolderFormQuest(); //處理上傳檔案 if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile) { //取得副檔名 string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1]; //新檔案名稱 string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName))); ModulePublish.AddParameter("fileUrl", fileName); } //處理上傳圖片 if (fuPic.HasFile) { if (fuPic.PostedFile.ContentType.IndexOf("image") == -1) { My.WebForm.doJavaScript("alert('檔案型態錯誤!');"); return; } //取得副檔名 string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1]; //新檔案名稱 string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName))); My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images"), "S", 69, 50); ModulePublish.AddParameter("picUrl", fileName); } ModulePublish.AddParameter("classID", ddlClass1.SelectedValue); //ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue); //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text); //ModulePublish.AddParameter("updater", person.name); //ModulePublish.AddParameter("updaterUnit", person.organization); //ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString()); //不填結束日期時,設定一個800年後的日期 if (string.IsNullOrEmpty(endDate.Text)) { ModulePublish.AddParameter("endDate", "2800/1/1"); } ModulePublish.UpdateById(Request["ID"]); EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents"); ModuleContents.AddParameter("publishID", Request["ID"]); ModuleContents.AddParameter("article", article.Text); ModuleContents.Update("publishID=@publishID"); Response.Redirect(String.Format("Discusses_List.aspx?ModuleID={0}&page={1}&grade_id={2}", Request["ModuleID"], Request["page"], Request["grade_id"])); }
protected void UpdateButton_Click(object sender, EventArgs e) { _EmailTemplats.SetPlaceHolderFormQuest(); _EmailTemplats.UpdateById(Request["id"]); Response.Redirect("EmailTemplat_List.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + ViewState["GUID"]); }
//private void ShowOrg() //{ // EasyDataProvide UnitName = new EasyDataProvide("UnitName"); // DataTable dt = UnitName.GetAllData(); // ddlOrg.DataSource = dt; // ddlOrg.DataBind(); //} protected void InsertButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(article.Text)) { My.WebForm.doJavaScript("alert('�Բӻ������i�H�ť�.');"); return; } if (shortDescription.Text.Length >= 500) { My.WebForm.doJavaScript("alert('²�满�����i�H�W�L500�Ӧr.');"); return; } Person person = new Person(); EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish"); ModulePublish.SetPlaceHolderFormQuest(); //�B�z�W���ɮ� if (ddlFile.SelectedValue == "�ɮפW��" && fuFile.HasFile) { //���o���ɦW string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1]; //�s�ɮצW�� string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName))); ModulePublish.AddParameter("fileUrl", fileName); } //�B�z�W�ǹϤ� if (fuPic.HasFile) { if (fuPic.PostedFile.ContentType.IndexOf("image") == -1) { My.WebForm.doJavaScript("alert('�ɮ��A���~!');"); return; } //���o���ɦW string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1]; //�s�ɮצW�� string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension); fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName))); ModulePublish.AddParameter("picUrl", fileName); } ModulePublish.AddParameter("classID", ddlClass1.SelectedValue); //ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue); //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text); //ModulePublish.AddParameter("updater", person.name); //ModulePublish.AddParameter("updaterUnit", person.organization); //ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString()); //�������ɡA�]�w�@��800�~�᪺��� if (string.IsNullOrEmpty(endDate.Text)) { ModulePublish.AddParameter("endDate", "2800/1/1"); } ModulePublish.UpdateById(Request["ID"]); EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents"); ModuleContents.AddParameter("publishID", Request["ID"]); ModuleContents.AddParameter("article", article.Text); ModuleContents.Update("publishID=@publishID"); Response.Redirect(String.Format("News_List.aspx?ModuleID={0}&page={1}", Request["ModuleID"], Request["page"])); }