Ejemplo n.º 1
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);
                }
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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>");
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        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>");

        }
Ejemplo n.º 7
-1
        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);
                }


            }

        }
Ejemplo n.º 8
-1
        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);
                }


                


            }
           
        }