protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { _orderId = id; GetOrderDetail(id); bind(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); //订单下面的操作按钮 //有订单操作权限的人 if (obj.IsOrderAlertAdmin(CurrentUser.UserId) || IsSuperAdmin) { obj.UpdateOrderMessageStatusAdmin(new Guid(_orderId), 1); isUserRead = 0; isAdminRead = 1; } else { //这里没有判断是不是自己的订单 obj.UpdateOrderMessageStatusUser(new Guid(_orderId), 1); isUserRead = 1; isAdminRead = 0; } } } }
protected void lbIsProcessing_Click(object sender, EventArgs e) { string mailBody = string.Empty; string mailSubject = string.Empty; string id = _orderId; int toStatus = (int)OrderStatus.IsProcessing; mailSubject = "您的订单被受理"; QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id, toStatus)) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>doAccept()</script>"); //发送邮件 mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus=" + toStatus.ToString() + "' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>sendMail('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string orderId = Request.QueryString["orderId"]; if (string.IsNullOrEmpty(orderId)) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>window.close();</script>"); return; } _orderId = orderId; bind(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); //订单下面的操作按钮 //有订单操作权限的人 if (obj.IsOrderAlertAdmin(CurrentUser.UserId) || IsSuperAdmin) { obj.UpdateOrderMessageStatusAdmin(new Guid(_orderId), 1); isUserRead = 0; isAdminRead = 1; } else { //这里没有判断是不是自己的订单 obj.UpdateOrderMessageStatusUser(new Guid(_orderId), 1); isUserRead = 1; isAdminRead = 0; } //bool isOrderUser = (this.txtUserName.Text.ToLower() == CurrentUser.UserLoginName.ToLower()); } }
private void bind() { QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataTable dt = obj.GetOrderMessageByOrderId(new Guid(_orderId)); this.rptOrderMessage.DataSource = dt; this.rptOrderMessage.DataBind(); }
private void bind() { DateTime start = Convert.ToDateTime(this.myOrder_StartDate.Text); DateTime end = Convert.ToDateTime(this.myOrder_EndDate.Text).AddDays(1); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataSet ds = obj.GetOrderStatus(start, end); this.rptOrderStat.DataSource = ds.Tables[0].DefaultView; this.rptOrderStat.DataBind(); }
protected void bindMyOrders() { DateTime begin = Convert.ToDateTime(this.myOrder_StartDate.Text); DateTime end = Convert.ToDateTime(this.myOrder_EndDate.Text).AddDays(1); string userId = CurrentUser.UserId.ToString(); int status = Convert.ToInt32(this.ddlStatus.SelectedValue); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataSet ds = obj.GetOrdersByUserId(userId, 10000, 1, begin, end, status); this.grvOrders.DataSource = ds.Tables[0]; this.grvOrders.DataBind(); }
protected void bindMyOrders() { DateTime begin = Convert.ToDateTime(this.myOrder_StartDate.Text); DateTime end = Convert.ToDateTime(this.myOrder_EndDate.Text).AddDays(1); string userId = CurrentUser.UserId.ToString(); int status = 0; int.TryParse(this.ddlStatus.SelectedValue, out status); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataSet ds = obj.GetOrdersByUserId("", 1, 1, begin, end,status); this.grvOrders.DataSource = ds.Tables[0]; this.grvOrders.DataBind(); }
private void bind() { QJVRMS.Business.Orders objOrder = new QJVRMS.Business.Orders(); DataTable dt = null; if (objOrder.IsOrderAlertAdmin(CurrentUser.UserId) || IsSuperAdmin) { dt = objOrder.IsOrderMessageAlertAdmin(); } else { dt = objOrder.IsOrderMessageAlertUser(CurrentUser.UserId); } this.rptOrders.DataSource = dt.DefaultView; this.rptOrders.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { string content = this.txtMessage.Text.Trim().Replace("'", "''"); if (content.Length < 1) { ShowMessage("内容不能为空"); return; } QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.AddOrderMessage(Guid.NewGuid(), new Guid(_orderId), content, DateTime.Now, CurrentUser.UserLoginName, isUserRead, isAdminRead)) { ShowMessage("成功"); bind(); } else { ShowMessage("失败"); } }
protected void grvOrders_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToLower().Equals("page")) { return; } int toStatus = 0; if (e.CommandName.ToLower().Equals("confirmorder")) { toStatus = (int)OrderStatus.Confirmed; } string id = e.CommandArgument.ToString(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id, toStatus)) { ShowMessage("操作完成"); bindMyOrders(); } }
protected void Button1_Click(object sender, EventArgs e) { string content = this.txtMessage.Text.Trim().Replace("'", "''"); if (content.Length < 1) { ShowMessage("内容不能为空"); return; } QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.AddOrderMessage(Guid.NewGuid(), new Guid(_orderId), content, DateTime.Now, CurrentUser.UserLoginName,isUserRead,isAdminRead)) { ShowMessage("成功"); bind(); } else { ShowMessage("失败"); } }
public void ProcessRequest(HttpContext context) { HttpRequest Request = context.Request; HttpResponse Response = context.Response; Response.ContentType = "text/plain"; string action = Request.QueryString["action"]; if (!string.IsNullOrEmpty(action)) { Orders obj = new Orders(); if (action.Trim().ToLower().Equals("delresource")) { string orderId = Request.QueryString["orderId"]; string resourceId = Request.QueryString["resourceId"]; try { if (obj.DelResourceFromOrders(orderId, resourceId) > 0) { Response.Write("删除成功"); Response.End(); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } Response.Write("删除失败"); Response.End(); } else if (action.Trim().ToLower().Equals("orderalert")) { //是否提醒 string userId=Request.QueryString["userId"]; if(!string.IsNullOrEmpty(userId)) { if (obj.IsOrderAlertAdmin(new Guid(userId))) { Response.Write("0"); //有权限的人 Response.End(); } else if (obj.IsOrderAlert(new Guid(userId))) { Response.Write("1"); //普通用户 Response.End(); } } Response.Write("2"); //不用提醒 Response.End(); } } }
protected void grvOrders_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToLower().Equals("page")) { return; } string mailBody = string.Empty; string mailSubject = string.Empty; int toStatus = 0; if (e.CommandName.ToLower().Equals("isprocessing")) { toStatus = (int)OrderStatus.IsProcessing; mailSubject = "您的订单被受理"; } else if (e.CommandName.ToLower().Equals("notpass")) { toStatus = (int)OrderStatus.NotPass; mailSubject = "您的订单没有被受理"; } else if (e.CommandName.ToLower().Equals("selectimage")) { //toStatus=(int)OrderStatus.IsProcessing; } else if (e.CommandName.ToLower().Equals("complete")) { toStatus = (int)OrderStatus.Completed; mailSubject = "您的订单已经完成,请上线查看相关图片"; } string id = e.CommandArgument.ToString(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id, toStatus)) { ShowMessage("操作完成"); bindMyOrders(); //发送邮件 mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("../orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); //mailBody = mailBody.Replace("{host}", Request.Url.Authority); //mailBody = mailBody.Replace("{apppath}", Request.ApplicationPath); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus=" + toStatus.ToString() + "' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>sendMail('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } }
protected void btnSave_Click(object sender, EventArgs e) { string _title = this.txtTitle.Text.Trim().Replace("'", "''"); string _rd = this.de_Date.Text; string _usage = this.ddlUsage.SelectedValue; string _content = this.txtContent.Text; _content += "\r\n工程性质:" + this.rblType.SelectedValue; _content += "\r\n主要关注点:" + this.rblFocus.SelectedValue; DateTime dtRq = DateTime.Now.AddMonths(1); try { dtRq = Convert.ToDateTime(_rd); } catch (Exception ex) { dtRq = DateTime.Now.AddMonths(1); } if (dtRq < DateTime.Today) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>orderDate();</script>"); return; } string userId = CurrentUser.UserId.ToString(); string userName = CurrentUser.UserLoginName.ToString(); string userRealName = CurrentUser.UserName.ToString(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); obj.Add(_title, dtRq, 0, _usage, _content, (int)OrderStatus.New, userId, userName); //发送邮件 string mailBody = "有新订单"; try { string templatePath = Server.MapPath("orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", DateTime.Now.ToString()); mailBody = mailBody.Replace("{txtUserName}", userName); mailBody = mailBody.Replace("{txtUserRealName}", userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", dtRq.ToString("yyyy-MM-dd")); mailBody = mailBody.Replace("{txtTitle}", _title); //mailBody = mailBody.Replace("{host}", Request.Url.Authority); //mailBody = mailBody.Replace("{apppath}", Request.ApplicationPath); //string link="<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2' target='_blank'>去我的订单中查看详细信息</a>"; string link = "<a href='http://{0}/{1}/Modules/Manage/OrdersManage.aspx?mi=1' target='_blank'>马上去处理该订单</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } Session["OrderNew"] = mailBody; //obj.sendNewOrder(mailBody); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>orderOk();</script>"); }
protected void btnValidate_Click(object sender, EventArgs e) { string reason = this.txtReason.Text.Trim().Replace("'", "''"); string id = this.hItemId.Value; QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id, (int)OrderStatus.NotPass)) { obj.AddOrderNotPassReason(id, reason); ShowMessage("操作完成"); //发送邮件 string mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("../orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus=" + ((int)OrderStatus.NotPass).ToString() + "' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); //这里需要改变一下,将收件人的地址加上 string mailSubject = "您的订单没有被受理"; Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>doClose('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>doClose();</script>"); }
protected void btnSave_Click(object sender, EventArgs e) { string _title=this.txtTitle.Text.Trim().Replace("'","''"); string _rd=this.de_Date.Text; string _usage = this.ddlUsage.SelectedValue; string _content=this.txtContent.Text; _content += "\r\n工程性质:" + this.rblType.SelectedValue; _content += "\r\n主要关注点:" + this.rblFocus.SelectedValue; DateTime dtRq=DateTime.Now.AddMonths(1); try { dtRq = Convert.ToDateTime(_rd); } catch (Exception ex) { dtRq = DateTime.Now.AddMonths(1); } if (dtRq < DateTime.Today) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>orderDate();</script>"); return; } string userId = CurrentUser.UserId.ToString(); string userName = CurrentUser.UserLoginName.ToString(); string userRealName=CurrentUser.UserName.ToString(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); obj.Add(_title, dtRq, 0, _usage, _content, (int)OrderStatus.New,userId,userName); //发送邮件 string mailBody="有新订单"; try { string templatePath = Server.MapPath("orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", DateTime.Now.ToString()); mailBody = mailBody.Replace("{txtUserName}", userName); mailBody = mailBody.Replace("{txtUserRealName}", userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n","<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", dtRq.ToString("yyyy-MM-dd")); mailBody = mailBody.Replace("{txtTitle}", _title); //mailBody = mailBody.Replace("{host}", Request.Url.Authority); //mailBody = mailBody.Replace("{apppath}", Request.ApplicationPath); //string link="<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2' target='_blank'>去我的订单中查看详细信息</a>"; string link = "<a href='http://{0}/{1}/Modules/Manage/OrdersManage.aspx?mi=1' target='_blank'>马上去处理该订单</a>"; mailBody = mailBody.Replace("{link}",string.Format(link,Request.Url.Authority,Request.ApplicationPath)); } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } Session["OrderNew"] = mailBody; //obj.sendNewOrder(mailBody); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>orderOk();</script>"); }
private void GetOrderDetail(string id) { QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataTable dt = obj.GetOrdersById(id).Tables[0]; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; this.txtContent.Text = dr["contents"].ToString().Replace("\n", "<br/>"); this.txtRD.Text = dr["RequestDate"].ToString(); this.txtTitle.Text = dr["title"].ToString(); this.txtUsage.Text = dr["usage"].ToString(); this.txtUserName.Text = dr["userName"].ToString(); this.txtAddDate.Text = dr["adddate"].ToString(); int imgCount = obj.GetOrderResourceCount(id); if (imgCount > 0) { this.linkImages.Visible = true; this.linkImages.NavigateUrl = "~/ResourceList.aspx?orderid=" + id; } else { this.linkImages.Visible = false; } bool isOrderUser = (this.txtUserName.Text.ToLower() == CurrentUser.UserLoginName.ToLower()); if (Convert.ToInt32(dr["status"].ToString()) == (int)OrderStatus.NotPass) { string reason = obj.GetOrderNotPassReason(id); this.notPassReason.Text = reason; this.pNotPass.Visible = true; } else { this.pNotPass.Visible = false; } //订单下面的操作按钮 //有订单操作权限的人 if (!obj.IsOrderAlertAdmin(CurrentUser.UserId) && !IsSuperAdmin && !isOrderUser) { this.tbCommand.Visible = false; return; } this.tbCommand.Visible = true; int state = Convert.ToInt32(dr["status"].ToString()); if (state == (int)OrderStatus.New) { this.lbIsProcessing.Visible = true; this.pNotPass1.Visible = true; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.IsProcessing) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = true; this.pImageDel.Visible = true; this.lbComplete.Visible = true; } else if (state == (int)OrderStatus.NotPass) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.Completed) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.Confirmed) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; this.pMessage.Visible = false; } if (isOrderUser) { if (state == (int)OrderStatus.Confirmed) { this.tbCommand.Visible = true; } else { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; this.pMessage.Visible = true; } } } }
protected void Page_Load(object sender, EventArgs e) { string result = string.Empty; string type = get_LinkParam("type"); string id = string.Empty; string body = string.Empty; Resource rs = new Resource(); switch (type) { case "orderNew"://OrderNew.aspx string mailFrom = ConfigurationManager.AppSettings["mailFrom"]; string mailSubject1 = ConfigurationManager.AppSettings["mailSubject"]; if (string.IsNullOrEmpty(mailSubject1)) { mailSubject1 = "有新的订单"; } Tool t1 = new Tool(); mailFrom = t1.GetValue(Tool.GetDocument("/xml/System.xml"), "from"); if (Session["OrderNew"] != null && Session["OrderNew"].ToString() != string.Empty) body = Session["OrderNew"].ToString(); Orders obj1 = new Orders(); obj1.sendNewOrder(mailFrom, mailSubject1, body); break; case "validate"://Validating.aspx string mail = get_LinkParam("mail"); string subject = get_LinkParam("subject"); if (Session["Validate"] != null && Session["Validate"].ToString() != string.Empty) body = Session["Validate"].ToString(); Tool t = new Tool(); XmlDocument doc = Tool.GetDocument("/xml/System.xml"); string smtpHost = t.GetValue(doc, "host"); string smtpUserName = t.GetValue(doc, "userName"); string smtpPassword = t.GetValue(doc, "password"); string fromEmail = t.GetValue(doc, "from"); Tool.sendMail(smtpHost, smtpUserName, smtpPassword, fromEmail, mail, subject, body); break; case "send"://OrdersManage.aspx OrderNotPass.aspx OrderDetail.aspx string _userEmail = get_LinkParam("mail"); string mailSubject = get_LinkParam("subject"); string mailBody = string.Empty; if (Session["MailBody"] != null && Session["MailBody"].ToString() != string.Empty) mailBody = Session["MailBody"].ToString(); if (!string.IsNullOrEmpty(_userEmail) && !string.IsNullOrEmpty(mailBody)) { Orders obj = new Orders(); obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); } break; case "error": //error.aspx string html = string.Empty; if(Session["ErrorHtml"] != null && Session["ErrorHtml"].ToString() != string.Empty) html = Session["ErrorHtml"].ToString(); if (!string.IsNullOrEmpty(html)) { XmlDocument doc1 = Tool.GetDocument("/xml/System.xml"); Tool tool = new Tool(); string host = tool.GetValue(doc1, "host"); string username = tool.GetValue(doc1, "userName"); string pass = tool.GetValue(doc1, "password"); string from = tool.GetValue(doc1, "from"); string adminUid = ConfigurationManager.AppSettings["superAdminId"]; string adminEmail = new MemberShipManager().GetUserEmailByUserID(adminUid); string to = adminEmail; string subject1 = "错误信息"; Tool.sendMail(host, username, pass, from, to, subject1, html); } break; case "exif": #region EXIF信息 string folderName = get_LinkParam("folder"); string fileName = get_LinkParam("file"); string yRootPath = string.Empty; try { ImageType obj = new ImageType(); yRootPath = obj.GetSourcePath(folderName, fileName); EXIFMetaData em = new EXIFMetaData(); EXIFMetaData.Metadata m = em.GetEXIFMetaData(yRootPath); StringBuilder sb = new StringBuilder(); sb.Append("<table>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>设备制造商:</span>"); sb.Append("</td><td style=\"word-wrap:break-word;word-break:break-all;\">"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.EquipmentMake.DisplayValue) ? string.Empty : m.EquipmentMake.DisplayValue.Replace("\0", string.Empty)); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>摄影机型号:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.CameraModel.DisplayValue) ? string.Empty : m.CameraModel.DisplayValue.Replace("\0", string.Empty)); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>颜色表示:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ColorSpace.DisplayValue) ? string.Empty : m.ColorSpace.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>闪关灯模式:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.Flash.DisplayValue) ? string.Empty : m.Flash.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>焦距:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.FocalLength.DisplayValue) ? string.Empty : m.FocalLength.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\">"); sb.Append("<span>曝光时间:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ExposureTime.DisplayValue) ? string.Empty : m.ExposureTime.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>ISO:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ISOSpeed.DisplayValue) ? string.Empty : m.ISOSpeed.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>光源:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.LightSource.DisplayValue) ? string.Empty : m.LightSource.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>曝光程序:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ExposureProg.DisplayValue) ? string.Empty : m.ExposureProg.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>曝光补偿:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ExposureBias.DisplayValue) ? string.Empty : m.ExposureBias.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>相机拍照时间:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.DatePictureTaken.DisplayValue) ? string.Empty : m.DatePictureTaken.DisplayValue.Replace("\0", string.Empty)); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>宽度:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ImageWidth.DisplayValue) ? string.Empty : m.ImageWidth.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>高度:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.ImageHeight.DisplayValue) ? string.Empty : m.ImageHeight.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>水平分辨率:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.XResolution.DisplayValue) ? string.Empty : m.XResolution.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("<tr><td align=\"left\" valign=\"top\" width=\"100px\"><span>垂直分辨率:</span>"); sb.Append("</td><td>"); sb.Append("<strong>"); sb.Append(string.IsNullOrEmpty(m.YResolution.DisplayValue) ? string.Empty : m.YResolution.DisplayValue); sb.Append("</strong>"); sb.Append("</td></tr>"); sb.Append("</table>"); result = sb.ToString(); } catch { if (string.IsNullOrEmpty(result)) { result = "<span style=\"color:red; padding:5px 5px 5px 5px;\">获取信息失败!!</span>"; } } #endregion break; } Response.Write(result); Response.End(); }
protected void btnValidate_Click(object sender, EventArgs e) { string reason = this.txtReason.Text.Trim().Replace("'", "''"); string id = this.hItemId.Value; QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id,(int)OrderStatus.NotPass)) { obj.AddOrderNotPassReason(id, reason); ShowMessage("操作完成"); //发送邮件 string mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("../orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus="+((int)OrderStatus.NotPass).ToString()+"' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); //这里需要改变一下,将收件人的地址加上 string mailSubject = "您的订单没有被受理"; Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>doClose('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>doClose();</script>"); }
private void GetOrderDetail(string id) { QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); DataTable dt=obj.GetOrdersById(id).Tables[0]; if (dt.Rows.Count > 0) { DataRow dr=dt.Rows[0]; this.txtContent.Text = dr["contents"].ToString().Replace("\n","<br/>"); this.txtRD.Text = dr["RequestDate"].ToString(); this.txtTitle.Text = dr["title"].ToString(); this.txtUsage.Text = dr["usage"].ToString(); this.txtUserName.Text = dr["userName"].ToString(); this.txtAddDate.Text = dr["adddate"].ToString(); int imgCount = obj.GetOrderResourceCount(id); if (imgCount > 0) { this.linkImages.Visible = true; this.linkImages.NavigateUrl = "~/ResourceList.aspx?orderid=" + id; } else { this.linkImages.Visible = false; } bool isOrderUser=(this.txtUserName.Text.ToLower()==CurrentUser.UserLoginName.ToLower()); if (Convert.ToInt32(dr["status"].ToString()) == (int)OrderStatus.NotPass) { string reason = obj.GetOrderNotPassReason(id); this.notPassReason.Text = reason; this.pNotPass.Visible = true; } else { this.pNotPass.Visible = false; } //订单下面的操作按钮 //有订单操作权限的人 if (!obj.IsOrderAlertAdmin(CurrentUser.UserId) && !IsSuperAdmin && !isOrderUser) { this.tbCommand.Visible = false; return; } this.tbCommand.Visible = true; int state = Convert.ToInt32(dr["status"].ToString()); if (state == (int)OrderStatus.New) { this.lbIsProcessing.Visible = true; this.pNotPass1.Visible = true; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.IsProcessing) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = true; this.pImageDel.Visible = true; this.lbComplete.Visible = true; } else if (state == (int)OrderStatus.NotPass) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.Completed) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; } else if (state == (int)OrderStatus.Confirmed) { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; this.pMessage.Visible = false; } if (isOrderUser) { if (state == (int)OrderStatus.Confirmed) { this.tbCommand.Visible = true; } else { this.lbIsProcessing.Visible = false; this.pNotPass1.Visible = false; this.pImage.Visible = false; this.pImageDel.Visible = false; this.lbComplete.Visible = false; this.pMessage.Visible = true; } } } }
protected void grvOrders_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToLower().Equals("page")) { return; } string mailBody = string.Empty; string mailSubject = string.Empty; int toStatus=0; if (e.CommandName.ToLower().Equals("isprocessing")) { toStatus=(int)OrderStatus.IsProcessing; mailSubject = "您的订单被受理"; } else if (e.CommandName.ToLower().Equals("notpass")) { toStatus=(int)OrderStatus.NotPass; mailSubject = "您的订单没有被受理"; } else if (e.CommandName.ToLower().Equals("selectimage")) { //toStatus=(int)OrderStatus.IsProcessing; } else if (e.CommandName.ToLower().Equals("complete")) { toStatus=(int)OrderStatus.Completed; mailSubject = "您的订单已经完成,请上线查看相关图片"; } string id = e.CommandArgument.ToString(); QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if(obj.UpdateStatus(id,toStatus)) { ShowMessage("操作完成"); bindMyOrders(); //发送邮件 mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("../orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); //mailBody = mailBody.Replace("{host}", Request.Url.Authority); //mailBody = mailBody.Replace("{apppath}", Request.ApplicationPath); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus=" + toStatus.ToString() + "' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>sendMail('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } }
protected void lbComplete_Click(object sender, EventArgs e) { string mailBody = string.Empty; string mailSubject = string.Empty; string id = _orderId; int toStatus = (int)OrderStatus.Completed; mailSubject = "您的订单已经完成,请上线查看相关图片"; QJVRMS.Business.Orders obj = new QJVRMS.Business.Orders(); if (obj.UpdateStatus(id, toStatus)) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>doAccept();</script>"); //发送邮件 mailBody = "订单"; try { DataSet ds = obj.GetOrdersById(id); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; string _title = dr["title"].ToString(); string _rd = dr["RequestDate"].ToString(); string _size = dr["RequestSize"].ToString(); string _usage = dr["usage"].ToString(); string _content = dr["contents"].ToString(); string _addDate = dr["AddDate"].ToString(); string _userName = dr["userName"].ToString(); MemberShipManager objUserOP = new MemberShipManager(); User objUser = objUserOP.GetUser(dr["userName"].ToString()); string _userRealName = objUser.UserName; string _userEmail = objUser.Email; string templatePath = Server.MapPath("orderMailTemplate.htm"); mailBody = new StreamReader(templatePath).ReadToEnd(); mailBody = mailBody.Replace("{txtAddDate}", _addDate); mailBody = mailBody.Replace("{txtUserName}", _userName); mailBody = mailBody.Replace("{txtUserRealName}", _userRealName); mailBody = mailBody.Replace("{txtContents}", _content.Replace("\r\n", "<br>")); mailBody = mailBody.Replace("{txtUsage}", _usage); mailBody = mailBody.Replace("{txtRD}", _rd); mailBody = mailBody.Replace("{txtTitle}", _title); string link = "<a href='http://{0}/{1}/Modules/UserProfile.aspx?tabid=2&orderStatus=" + toStatus.ToString() + "' target='_blank'>去我的订单中查看详细信息</a>"; mailBody = mailBody.Replace("{link}", string.Format(link, Request.Url.Authority, Request.ApplicationPath)); Session["MailBody"] = mailBody; //obj.sendNewOrderToUser(_userEmail, mailSubject, mailBody); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language='javascript'>sendMail('" + _userEmail + "', '" + mailSubject + "')</script>"); } } catch (Exception ex) { LogWriter.WriteExceptionLog(ex); } } }