protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strContent = Request.Form["t_contents"].ToString(); NewsInfo news = new NewsInfo(); news.N_Title = txtTitle.Text; news.N_From = txtFrom.Text; news.N_Content = PubClass.Tool.CheckStr(strContent); news.N_ImgPath = ""; news.N_ImgView = ""; news.N_HotIco = ""; news.N_PicIco = ""; news.N_Time = txtTime.Text; news.N_TID = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]); if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); NewsInfoService.Update_NewsInfoWithTime(news); } else if (ViewState["strAction"].ToString() == "add") { NewsInfoService.Insert_NewsInfoWithTime(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "CommonNewsMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"])); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { NewsInfo news = new NewsInfo(); news.N_Title = txtTitle.Text.Trim(); news.N_From = "河南省高速公路路警联合指挥中心"; news.N_Content = txtContent.Text; news.N_ImgPath = ""; news.N_ImgView = ""; news.N_HotIco = ""; news.N_PicIco = ""; news.N_Time = txtTime.Text; news.N_TID = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]); if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); NewsInfoService.Update_NewsInfoWithTime(news); } else if (ViewState["strAction"].ToString() == "add") { NewsInfoService.Insert_NewsInfoWithTime(news); } if (Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]) == 80) { CommonFunction.AlertAndRedirect(Literal1, "操作成功", "CurrentRoadContion.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"])); } else if (Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]) == 81) { CommonFunction.AlertAndRedirect(Literal1, "操作成功", "HistoryRoadCondition.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"])); } }
protected void btnAdd_Click(object sender, ImageClickEventArgs e) { string fileName = fileName = CommonFunction.Get_DynamicString() + FileUploadImg.FileName; string vfileName = "v_" + fileName; string vvfileName = "vv_" + fileName; string file_Path = Server.MapPath("~/CertificateImg/" + fileName); string vfile_Path = Server.MapPath("~/CertificateImg/" + vfileName); string vvfile_Path = Server.MapPath("~/CertificateImg/" + vvfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImg, Literal1, file_Path, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(file_Path, vfile_Path, 120, 90, "W"); ImgUploadFunction.MakeThumbnail(file_Path, vvfile_Path, 600, 450, "W"); System.IO.File.Delete(file_Path); ServiceNews news = new ServiceNews(); news.N_Title = "[" + vfileName + "]{" + vvfileName + "}"; news.N_Content = txtRemark.Text; news.N_SID = ((UserInfo)Session["ServiceUser"]).U_SID; news.N_Time = DateTime.Now; news.N_NewsType = "9"; news.N_From = "本站原创"; ServiceNewService.Insert_News(news); CommonFunction.AlertAndRedirect(Literal1, "操作成功", "CertificateMgr.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strContent = Request.Form["t_contents"].ToString(); if (strContent == "") { CommonFunction.Alert(Literal1, "文章内容不能为空"); return; } ServiceItem item = new ServiceItem(); item.I_Title = txtTitle.Text; item.I_Content = strContent; item.I_SID = ((UserInfo)Session["ServiceUser"]).U_SID; item.I_MID = ViewState["mid"].ToString(); if (ViewState["strAction"].ToString() == "add") { ServiceItemService.Insert_ServiceItem(item); } else if (ViewState["strAction"].ToString() == "update") { item.I_ID = Convert.ToInt32(ViewState["iid"]); ServiceItemService.Update_ServiceItem(item); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "blank.aspx"); }
protected void btnLogin_Click(object sender, EventArgs e) { if (txtName.Text.Trim() == "") { this.Literal1.Text = "<script>alert('请输入用户名');</script>"; return; } if (txtPwd.Text.Trim() == "") { this.Literal1.Text = "<script>alert('请输入密码');</script>"; return; } if (Session["CheckCode"].ToString() != txtCode.Text) { this.Literal1.Text = "<script>alert('验证码错误');</script>"; return; } UserInfo info = null; info = UserInfoService.Get_UserInfo(txtName.Text.Trim()); if (info != null && info.U_Pwd == txtPwd.Text.Trim()) { Session["ServiceUser"] = info; CommonFunction.AlertAndRedirect(this.Literal1, "登陆成功", "MainMgr.aspx"); } else { this.Literal1.Text = "<script>alert('用户名或密码错误');</script>"; return; } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strContent = Request.Form["t_contents"].ToString(); if (strContent == "") { CommonFunction.Alert(Literal1, "文章内容不能为空"); return; } ServiceNews news = new ServiceNews(); news.N_Title = txtTitle.Text; news.N_Content = strContent; news.N_SID = ((UserInfo)Session["ServiceUser"]).U_SID; news.N_NewsType = ViewState["tid"].ToString(); news.N_From = txtForm.Text; news.N_Time = DateTime.Parse(txtdate.Text); if (ViewState["strAction"].ToString() == "add") { ServiceNewService.Insert_News(news); } else if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); ServiceNewService.Update_News(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "blank.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (ViewState["strAction"].ToString() == "add" || FileUploadHTML.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadHTML.FileName; string filePath = Server.MapPath("~/workexpress/" + fileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadHTML, Literal1, filePath, new string[] { ".html", "htm", "shtml" })) { return; } ViewState["HTML"] = fileName; } NewsInfo news = new NewsInfo(); news.N_Title = txtTitle.Text; news.N_From = txtFrom.Text; news.N_Content = ""; news.N_ImgPath = ViewState["HTML"].ToString(); news.N_ImgView = ""; news.N_HotIco = ""; news.N_PicIco = ""; news.N_Time = txtTime.Text; news.N_TID = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]); if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); NewsInfoService.Update_NewsInfoWithTime(news); } else if (ViewState["strAction"].ToString() == "add") { NewsInfoService.Insert_NewsInfoWithTime(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "WorkExpressMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"])); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strContent = Request.Form["t_contents"].ToString(); if (cboxPic.Checked) { if (ViewState["strAction"].ToString() == "add" && (!FUploadImg.HasFile || !FUploadView.HasFile)) { CommonFunction.Alert(Literal1, "请上传缩略图和图片!"); return; } string fileName = CommonFunction.Get_DynamicString() + FUploadImg.FileName; string vfileName = CommonFunction.Get_DynamicString() + FUploadView.FileName; string filePath = Server.MapPath("~/newsimages/" + fileName); string vfilePath = Server.MapPath("~/newsimages/" + vfileName); if (FUploadImg.HasFile) { if (!CommonFunction.Is_FileUploadSuccessfully(FUploadImg, Literal1, filePath, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ViewState["ImgPath"] = fileName; } if (FUploadView.HasFile) { if (!CommonFunction.Is_FileUploadSuccessfully(FUploadView, Literal1, vfilePath, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ViewState["ImgView"] = vfileName; } ViewState["ImgIco"] = "图片新闻"; } NewsInfo news = new NewsInfo(); news.N_Title = txtTitle.Text; news.N_From = txtFrom.Text; news.N_Content = PubClass.Tool.CheckStr(strContent); news.N_ImgPath = ViewState["ImgPath"].ToString(); news.N_ImgView = ViewState["ImgView"].ToString(); news.N_HotIco = txtRemarkContent.Text.Trim(); news.N_PicIco = ViewState["ImgIco"].ToString(); news.N_Time = txtTime.Text; news.N_TID = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]); if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); NewsInfoService.Update_NewsInfoWithTime(news); } else if (ViewState["strAction"].ToString() == "add") { NewsInfoService.Insert_NewsInfoWithTime(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "ImageTextRemarkNewsMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"])); }
protected void btnSaveImage_Click(object sender, ImageClickEventArgs e) { if (FileUploadImg.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImg.FileName; string filePath = Server.MapPath("~/ServiceImg/" + fileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImg, Literal1, filePath, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } int result = ServiceInfoService.Update_ServiceImage(Convert.ToInt32(ViewState["SID"]), "S_HeaderImg", fileName); CommonFunction.AlertAndRedirect(Literal1, "操作成功", "SiteMainImg.aspx"); } }
/// <summary> /// 判断是否登录,没有登录则无权操作其他页面 /// </summary> public static void isLoginCheck() { if (HttpContext.Current.Session["ServiceUser"] != null) { if (HttpContext.Current.Session["ServiceUser"].ToString().Length == 0) { CommonFunction.AlertAndRedirect("用户登陆失败,或未登陆!", "Login.aspx"); HttpContext.Current.Response.End(); } } else { CommonFunction.AlertAndRedirect("用户登陆失败,或未登陆!", "Login.aspx"); HttpContext.Current.Response.End(); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { MyLink link = new MyLink(); link.L_Title = txtTitle.Text; link.L_URL = txtURL.Text; link.L_SID = ((UserInfo)Session["ServiceUser"]).U_SID; if (ViewState["strAction"].ToString() == "update") { link.L_ID = Convert.ToInt32(ViewState["lid"]); MyLinkService.Update_MyLink(link); } else if (ViewState["strAction"].ToString() == "add") { MyLinkService.Insert_MyLink(link); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "MyLinkMgr.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { KnowledgeArticle article = new KnowledgeArticle(); article.KA_Title = txtTitle.Text.Trim(); article.KA_CreateDate = txtTime.Text; article.KA_KMID = Convert.ToInt32(((DataTable)ViewState["dtModule"]).Rows[0]["KM_ID"]); article.KA_Content = Request.Form["t_contents"].ToString(); if (ViewState["action"].ToString() == "add") { KnowledgeArticleService.Insert_KnowledgeArticle(article); } else if (ViewState["action"].ToString() == "update") { article.KA_ID = Convert.ToInt32(ViewState["kaid"]); KnowledgeArticleService.Update_KnowledgeArticle(article); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "KnowledgeArticleMgr.aspx?kmid=" + Convert.ToInt32(((DataTable)ViewState["dtModule"]).Rows[0]["KM_ID"])); }
protected void btnSaveImage_Click(object sender, ImageClickEventArgs e) { if (ViewState["strAction"].ToString() == "add" || FileUploadImg.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImg.FileName; string vfileName = "v_" + fileName; string vvfileName = "vv_" + fileName; string filePath = Server.MapPath("~/newsImages/" + fileName); string vfilePath = Server.MapPath("~/newsImages/" + vfileName); string vvfilePath = Server.MapPath("~/newsImages/" + vvfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImg, Literal1, filePath, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(filePath, vfilePath, 150, 112, "W"); ImgUploadFunction.MakeThumbnail(filePath, vvfilePath, 600, 480, "W"); System.IO.File.Delete(filePath); ViewState["VImgURL"] = vfileName; ViewState["VVImgURL"] = vvfileName; } string strContent = Request.Form["t_contents"].ToString(); string strTitle = "(" + txtTitle.Text + ")[" + ViewState["VImgURL"].ToString() + "]{" + ViewState["VVImgURL"].ToString() + "}"; ServiceNews news = new ServiceNews(); news.N_Title = strTitle; news.N_Content = strContent; news.N_From = "本站原创"; news.N_SID = ((UserInfo)Session["ServiceUser"]).U_SID; news.N_NewsType = "6"; news.N_Time = DateTime.Parse(txtdate.Text.Trim()); if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); ServiceNewService.Update_News(news); } else if (ViewState["strAction"].ToString() == "add") { ServiceNewService.Insert_News(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "blank.aspx"); }
protected void btnAdd_Click(object sender, ImageClickEventArgs e) { ServiceNews news = new ServiceNews(); news.N_Title = ""; news.N_Content = txtNotice.Text; news.N_SID = ((UserInfo)Session["ServiceUser"]).U_SID; news.N_NewsType = "2"; news.N_From = "本站原创"; news.N_Time = DateTime.Parse(txtdate.Text); if (ViewState["strAction"].ToString() == "add") { ServiceNewService.Insert_News(news); } else if (ViewState["strAction"].ToString() == "update") { news.N_ID = Convert.ToInt32(ViewState["nid"]); ServiceNewService.Update_News(news); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "blank.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (!FileUpload1.HasFile) { CommonFunction.Alert(Literal1, "请选择要上传的文件"); return; } string fileName = CommonFunction.Get_DynamicString() + FileUpload1.FileName; string filePath = Server.MapPath("~/DownLoad/" + fileName); int fileSzie = Convert.ToInt32(FileUpload1.PostedFile.ContentLength / 1024); FileUpload1.PostedFile.SaveAs(filePath); FileDownload download = new FileDownload(); download.FD_Title = txtTitle.Text; download.FD_FTID = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["FT_ID"]); download.FD_Path = fileName; download.FD_Size = fileSzie + "KB"; download.FD_CreateDate = txtTime.Text; FileDownloadService.Insert_FileDownload(download); CommonFunction.AlertAndRedirect(Literal1, "上传成功", "FileDownloadMgr.aspx?ftid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["FT_ID"])); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (FUploadXls.HasFile == false) { CommonFunction.Alert(Literal1, "请您选择Excel文件"); return; } string IsXls = System.IO.Path.GetExtension(FUploadXls.FileName).ToString().ToLower(); if (IsXls != ".xls") { CommonFunction.Alert(Literal1, "只可以选择Excel文件"); return; } string filename = CommonFunction.Get_DynamicString() + ".xls"; string filePath = Server.MapPath("~/AdminMgr/xls/" + filename); FUploadXls.PostedFile.SaveAs(filePath); DataSet ds = ExcelSqlConnection(filePath, filename); DataTable dt = ds.Tables[0]; if (dt == null || dt.Rows.Count == 0) { CommonFunction.Alert(Literal1, "'Excel表为空表,无数据!"); return; } for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][1] == null || dt.Rows[i][1].ToString().Trim() == "") { continue; } string sqlStr = "INSERT INTO Main_OverRunInfo" + "([OI_LicencePlate]" + ",[OI_Length]" + " ,[OI_Width]" + " ,[OI_Heigth]" + " ,[OI_GoodsName]" + " ,[OI_Weight]" + " ,[OI_Path]" + " ,[OI_CreateDate]" + " ,[OI_PassDate]" + " ,[OI_TransUnit]" + " ,[OI_PassCode]" + " ,[OI_Remark])" + " VALUES(" + " '" + dt.Rows[i][1] + "'" + " ,'" + dt.Rows[i][2] + "'" + " ,'" + dt.Rows[i][3] + "'" + " ,'" + dt.Rows[i][4] + "'" + " ,'" + dt.Rows[i][5] + "'" + " ,'" + dt.Rows[i][6] + "'" + " ,'" + dt.Rows[i][7] + "'" + " ,'" + dt.Rows[i][8] + "'" + " ,'" + dt.Rows[i][9] + "'" + " ,'" + dt.Rows[i][10] + "'" + " ,'" + dt.Rows[i][11] + "'" + " ,'" + dt.Rows[i][12] + "')"; DBHelper.ExecuteCommand(sqlStr); } CommonFunction.AlertAndRedirect(Literal1, "导入完毕", "ChaoXianMgr.aspx"); }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { MessageBoardService.Reply_MessageBoard(Convert.ToInt32(ViewState["mid"]), lblReply.Text); CommonFunction.AlertAndRedirect(Literal1, "操作成功", "MessageBoardList.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { MessageBoardService.Reply_MessageBoard(mid, txtReply.Text); CommonFunction.AlertAndRedirect(Literal1, "操作成功", "MessageBoardMgr.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (FileUploadImgA.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImgA.FileName; string vfileName = "v_" + fileName; string file_Path = Server.MapPath("~/newspaper/" + fileName); string vfile_Path = Server.MapPath("~/newspaper/" + vfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImgA, Literal1, file_Path, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(file_Path, vfile_Path, 152, 225, "HW"); ViewState["strAImg"] = fileName; ViewState["strAImgView"] = vfileName; } if (FileUploadImgB.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImgB.FileName; string vfileName = "v_" + fileName; string file_Path = Server.MapPath("~/newspaper/" + fileName); string vfile_Path = Server.MapPath("~/newspaper/" + vfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImgB, Literal1, file_Path, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(file_Path, vfile_Path, 152, 225, "HW"); ViewState["strBImg"] = fileName; ViewState["strBImgView"] = vfileName; } if (FileUploadImgC.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImgC.FileName; string vfileName = "v_" + fileName; string file_Path = Server.MapPath("~/newspaper/" + fileName); string vfile_Path = Server.MapPath("~/newspaper/" + vfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImgC, Literal1, file_Path, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(file_Path, vfile_Path, 152, 225, "HW"); ViewState["strCImg"] = fileName; ViewState["strCImgView"] = vfileName; } if (FileUploadImgD.HasFile) { string fileName = CommonFunction.Get_DynamicString() + FileUploadImgD.FileName; string vfileName = "v_" + fileName; string file_Path = Server.MapPath("~/newspaper/" + fileName); string vfile_Path = Server.MapPath("~/newspaper/" + vfileName); if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadImgD, Literal1, file_Path, new string[] { ".gif", ".jpg", ".jpeg" })) { return; } ImgUploadFunction.MakeThumbnail(file_Path, vfile_Path, 152, 225, "HW"); ViewState["strDImg"] = fileName; ViewState["strDImgView"] = vfileName; } NewsPaper paper = new NewsPaper(); paper.N_Title = txtTitle.Text; paper.N_Time = txtTime.Text; paper.N_AImg = ViewState["strAImg"].ToString(); paper.N_AImgView = ViewState["strAImgView"].ToString(); paper.N_BImg = ViewState["strBImg"].ToString(); paper.N_BImgView = ViewState["strBImgView"].ToString(); paper.N_CImg = ViewState["strCImg"].ToString(); paper.N_CImgView = ViewState["strCImgView"].ToString(); paper.N_DImg = ViewState["strDImg"].ToString(); paper.N_DImgView = ViewState["strDImgView"].ToString(); if (ViewState["strAction"].ToString() == "update") { paper.N_ID = Convert.ToInt32(ViewState["nid"]); NewsPaperService.Update_NewsPaper(paper); } else if (ViewState["strAction"].ToString() == "add") { NewsPaperService.Insert_NewsPaper(paper); } CommonFunction.AlertAndRedirect(Literal1, "操作成功", "NewsPaperMgr.aspx"); }