public int Reply(OrderCancelResponse ocr)
 {
     try
     {
         return icancelDao.Reply(ocr);
     }
     catch (Exception ex)
     {
         throw new Exception("OrderCancelMsgMgr.Reply-->" + ex.Message, ex);
     }
 }
        /// <summary>
        /// 對用戶的問題與意見進行回覆
        /// </summary>
        /// <param name="cancel_id"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public int Reply(OrderCancelResponse ocr)
        {
            string sql = string.Empty;
            int i = 0;
            MySqlCommand mySqlCmd = new MySqlCommand();
            MySqlConnection mySqlConn = new MySqlConnection(connString);
            try
            {
                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Closed)
                {
                    mySqlConn.Open();
                }
                mySqlCmd.Connection = mySqlConn;
                mySqlCmd.Transaction = mySqlConn.BeginTransaction();

                mySqlCmd.CommandType = System.Data.CommandType.Text;
                sql = string.Format("update	order_cancel_msg set cancel_status = 1 where cancel_id ={0} and	cancel_status = 0", ocr.cancel_id);
                mySqlCmd.CommandText = sql;
                i += mySqlCmd.ExecuteNonQuery();
                _serialDao = new SerialDao(connString);
                mySqlCmd.CommandText = _serialDao.Update(37);
                string response_id = mySqlCmd.ExecuteScalar().ToString();
                sql = string.Format("insert into order_cancel_response(response_id,cancel_id,user_id,response_content,response_createdate,response_ipfrom)");
                sql += string.Format(" values({0},{1},{2},'{3}',{4},'{5}')", response_id, ocr.cancel_id,ocr.user_id,ocr.response_content,CommonFunction.GetPHPTime(DateTime.Now.ToString()), ocr.response_ipfrom);
                mySqlCmd.CommandText = sql;
                i += mySqlCmd.ExecuteNonQuery();
                mySqlCmd.Transaction.Commit();
            }
            catch (Exception ex)
            {
                mySqlCmd.Transaction.Rollback();
                throw new Exception("OrderCancelMsgDao-->Reply-->" + ex.Message+sql.ToString(), ex);
            }
            finally
            {
                if (mySqlConn != null && mySqlConn.State == System.Data.ConnectionState.Open)
                {
                    mySqlConn.Close();
                }
            }
            return i;

        }
 public HttpResponseBase Reply()
 {
     string json = string.Empty;
     string response_content = string.Empty;
     OrderCancelResponse ocr = new OrderCancelResponse();
     _ptersrc = new ParameterMgr(mySqlConnectionString);
     int i = 0;
     string cancel_id = string.Empty; ;
     if (!string.IsNullOrEmpty(Request.Params["cancel_id"]))
     {
         cancel_id = Request.Params["cancel_id"];
         ocr.cancel_id = uint.Parse(cancel_id);
     }
     string question_email = string.Empty;
     if (!string.IsNullOrEmpty(Request.Params["question_email"]))
     {
         question_email = Request.Params["question_email"];
     }
     //獲取登錄用戶的user_email
     string user_email = (Session["caller"] as Caller).user_email;
     //獲取登錄用戶的user_id
     string user_id = (Session["caller"] as Caller).user_id.ToString();
     string res;
     try
     {
         res = Request.Params["response"].ToString().Trim();
         res = res.Replace("\n", "");
         if (res.Length > 0)
         {
             response_content = Request.Params["response"] + " ";
             ocr.user_id = uint.Parse(user_id);
             ocr.response_content = response_content;
             System.Net.IPAddress[] addlist = Dns.GetHostEntry(Dns.GetHostName()).AddressList;
             if (addlist.Length > 0)
             {
                 ocr.response_ipfrom = addlist[0].ToString();
             }
             _orderCancelMsgMgr = new OrderCancelMsgMgr(mySqlConnectionString);
             i = _orderCancelMsgMgr.Reply(ocr);
             bool issend = false;
             if (i == 2)
             {
                 MailHelper mail = new MailHelper();
                 string mail1 = _ptersrc.Getmail("TestMail");
                 if (mail1 == "*****@*****.**")
                 {//測試使用上正式機后可變更為gigademail則是讀取會員mail
                     mail1 = question_email;
                 }
                 issend = mail.SendMailAction(mail1, "取消訂單通知信", response_content);
             }
             json = "{success:true,msg:\"" + " 發送郵件成功!" + "\"}";
         }
         else
         {
             json = "{success:false,msg:\"" + "请填写回覆内容!" + "\"}";
         }
     }
     catch (Exception ex)
     {
         Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
         logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
         logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
         log.Error(logMessage);
         json = ex.InnerException.Message;
         json = ex.InnerException.Source;
         json = "{success:false,msg:\"" + " 發送郵件失敗!" + "\"}";
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }