예제 #1
0
 public string SaveTicketReturn(TicketReturnQuery query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         query.Replace4MySQL();
         sql.AppendFormat("set sql_safe_updates=0;update ticket_return set tr_note ='{0}',tr_bank_note='{1}',tr_update_user='******'", query.tr_note, query.tr_bank_note, query.tr_update_user);
         sql.AppendFormat(",tr_update_date='{0}',tr_money='{1}', tr_status='{2}',tr_reason_type='{3}'",CommonFunction.DateTimeToString(DateTime.Now),query.tr_money,query.tr_status,query.tr_reason_type);
         sql.AppendFormat(" where tr_id='{0}';set sql_safe_updates=1; ", query.tr_id);
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception("TicketReturnDao-->SaveTicketReturn-->"+sql.ToString()+ex.Message,ex);
     }
 }
예제 #2
0
 public string SaveTicketReturnLog(TicketReturnQuery query)
 {
     StringBuilder sql = new StringBuilder();
     try
     {
         query.Replace4MySQL();
         sql.AppendFormat("insert into ticket_return_change_log (tr_id,trcl_last_status,trcl_new_status,trcl_new_money,trcl_last_money, ");
         sql.AppendFormat("trcl_create_user,trcl_create_date,trcl_note)   ");
         sql.AppendFormat("values('{0}','{1}','{2}','{3}','{4}',", query.tr_id, query.trcl_last_status, query.tr_status, query.tr_money, query.trcl_last_money);
         sql.AppendFormat("'{0}','{1}','{2}');", query.trcl_create_user, CommonFunction.GetPHPTime() , query.tr_note);
         return sql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception("TicketReturnDao-->SaveTicketReturnLog-->" + sql.ToString() + ex.Message, ex);
     }
 }